Skip to content

Instantly share code, notes, and snippets.

View karimlahlou's full-sized avatar

Karim lahlou karimlahlou

View GitHub Profile
@karimlahlou
karimlahlou / fix-t2-macbook.sh
Last active August 19, 2026 18:06
Automated fix for Apple T2 MacBook Pro hardware (keyboard, trackpad, Touch Bar, audio) on Ubuntu.
#!/usr/bin/env bash
#
# fix-t2-macbook.sh
# Script to restore Apple T2 drivers, kernel, Touch Bar, and audio support after an OS upgrade.
#
set -euo pipefail
# Ensure the script is run with root privileges
if [ "${EUID}" -ne 0 ]; then