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?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

I had a similar issue with a Varmilo VA109M Keyboard (for some reason it registers as an apple keyboard).

I’m running Ubuntu 20.04, and everything worked after doing these steps from this guide:

  1. Run the following command to append the configuration line to the file /etc/modprobe.d/hid_apple.conf creating it if necessary:

    $ echo options hid_apple fnmode=0 | sudo tee -a /etc/modprobe.d/hid_apple.conf
  2. Trigger copying the configuration into the initramfs bootfile.

    $ sudo update-initramfs -u -k all
  3. Reboot

    $ sudo reboot

You may need to echo different options into your /etc/modprobe.d/hid_apple.conf file, to setup your keyboard to your liking.

Solution 2

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.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply