Magnificient ArchWiki specifies optimal way to use Apple KB on Arch Linux, however because of some changes in udev module AUR package un-apple-keyboard
doesn’t really work out of the box. Edit: Looks like it’s working okay now.
To make changes like:
- Adds a /etc/modprobe.d/hid_apple.conf file which enables the F keys by default, as above.
- Uses keyfuzz to remap F13-15 to PrintScreen/SysRq, Scroll Lock, and Pause, respectively
- Swaps the ordering of the Alt and Meta (Command) keys to match all other keyboards, again using keyfuzz.
- Applies these changes automatically when you plug in your keyboard, with a udev rule.
We’ve got to enable keyfuzz by
systemctl enable keyfuzz and run additional keyfuzz script on boot. I just add execution to my /home/username/.bashrc file:
sudo keyfuzz -s -d /dev/input/by-id/usb-Apple__Inc_Apple_Keyboard-event-kbd < /etc/keyfuzz/apple_aluminium.keyfuzz
To make it execute passwordless it’s also needed to make light change in /etc/sudoers file, eg.
(... some lines)
username ALL=NOPASSWD: /usr/bin/keyfuzz
Also I experienced strange problem that holding left and down arrows sometimes doesn’t repeat key action. To workaround it there’s additional change on startup (so .bashrc again).
xset r 113; xset r 116
And now it’s perfect! Fn+F1-F19 button combinations are great to assign some additional functions also.
Source 1: https://wiki.archlinux.org/index.php/Apple_Keyboard
Source 2: https://aur.archlinux.org/packages/un-apple-keyboard/