Unix & Linux
ubuntu keyboard kernel-modules settings apple
Updated Thu, 22 Sep 2022 04:31:25 GMT

Make Apple Keyboard Settings persistent in ../hid_apple/parameters/


i'm running Ubuntu 16.04 LTS and want to use an apple keyboard (wired). No i'm facing some problems whith making my custom settings permanent. I'm using the 'English internationl, AltGr dead keys' layout.

The keyboard has some keys swapped and i set the settings manually in the /sys/module/hid_apple/parameters/ folder. I set fnmode to 2 , iso_layout to 0 and swap_opt_cmd to 1. After this everything works like intended. But after rebooting the settings are back to the default. I have to reset everything manually after each reboot.

For now i wrote a little shell script which would do it but that's not the best way i think.

How can i make these settings persistent?




Solution

It appears that you can create /etc/modprobe.d/hid_apple.conf and add the entries you need fixing in there, such as,

options hid_apple fnmode=2

NB: This assumes the hid_apple module is already being loaded.





Comments (5)

  • +1 – That did only work for logout and login again. After rebooting settings have been reset and i have to reload the module manually via modprobe ... which needs a keyboard to unload and reload it. Or another script ... — Nov 29, 2017 at 15:24  
  • +0 – After the reboot, does /etc/modprobe.d/hid_apple.conf still exist, and does it still have that line in it? — Nov 29, 2017 at 21:03  
  • +0 – It is still there.. Do i have to enable loading in any way? — Dec 03, 2017 at 11:14  
  • +1 – I found it... I had to add hid_apple to /etc/modules. After doing this the correct settings have been set. Thanks! — Dec 03, 2017 at 11:48  
  • +0 – Same thing on Arch Linux. Editing /etcf/modprobe.d/hid_apple.conf and then running mkinitcpio -p linux did the trick here. — Feb 11, 2021 at 22:28