17 lines
540 B
Bash
Executable File
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
|