Files
dotfiles/scripts/fixMacPortableKeyboard.sh
tmerritt 391318a839 Adds SSH server and Axel
Adding fix for Apple keyboard F keys on MBP and MBA
2022-11-29 09:48:41 -05:00

17 lines
540 B
Bash
Executable File

#!/bin/bash
if [ -f "/sys/module/hid_apple/parameters/fn_mode" ]; then
echo "Found a Mac! Lets see about the keyboard..."
if [ ! -f "/etc/modprobe.d/hid_apple.conf"]; then
echo "Applying runtime fix"
sudo su -c "echo -n 0x02 > /sys/module/hid_apple/parameters/fnmode"
echo "Applying Boot fix..."
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
update-initramfs -u -k all
else
echo "Keyboard already fixed."
fi
else
echo "Not a mac."
fi