Skip to content

Instantly share code, notes, and snippets.

@randombenj
Created March 27, 2020 07:15
Show Gist options
  • Save randombenj/bd2637d5a198ed50a564191f6718f2c6 to your computer and use it in GitHub Desktop.
Save randombenj/bd2637d5a198ed50a564191f6718f2c6 to your computer and use it in GitHub Desktop.
r.a.t. 7 & apple keyboard setup
[ $(id) -eq 0 ] || echo "error: run this script as root" && exit 1
# -- setup apple function keys (https://askubuntu.com/a/7553)
echo 2 > /sys/module/hid_apple/parameters/fnmode # temp enabled
# permanently enabled
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
update-initramfs -u -k all
# -- setup R.A.T. 7 mouse (https://gist.github.com/pubkey/31ef83263bb5451ff904304d161f40e2)
mkdir -p /etc/X11/xorg.conf.d
cat <<EOF > /etc/X11/xorg.conf.d/910-rat.conf
Section "InputClass"
Identifier "R.A.T."
MatchProduct "R.A.T.7|R.A.T.9"
MatchDevicePath "/dev/input/event*"
Option "Buttons" "17"
Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 16 17"
Option "AutoReleaseButtons" "13 14 15"
Option "ZAxisMapping" "4 5 6 7"
EndSection
EOF
echo "done. you may want to run 'reboot now'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment