Fixing Varmilo/Similar keyboards being mistaken for a Apple keyboard under Linux

I was given a Varmilo keyboard some time ago and it works fine on MacOS and Windows. But on Linux the FN (function) keys are reversed. Normally you hold down FN and press a number for an FN key, but on Linux you get media-keys instead. You can get FN-keys by pressing FN+PageDown, pressing the number and then FN-PageUp. This is annoying. The hid-apple kernel module is meant to fix this BUT for keyboards that are mistaken for an Apple keyboard it is a bit more finicky. I searched for quite a while and finally found a configuration that works for me.

This has been done on Arch Linux, but should also work on other distributions if you know where to put the files and configure things in the right places.


First I had to update the firmware. I would recommend doing this in a VM!

https://en.varmilo.com/keyboardproscenium/Driverdownload


Then I configured hid-apple correctly:

Creating the config file:

echo options hid_apple fnmode=0 | sudo tee -a /etc/modprobe.d/hid_apple.conf


Checking if the file was created correctly (EXIT! DON'T SAVE!):

sudo nano /etc/modprobe.d/hid_apple.conf


Reload the hid-apple-module-config to check if it works:

sudo rmmod hid_apple; sudo modprobe hid_apple


Makeing it permanent:

sudo mkinitcpio -p linux

or

sudo dracut -v -f


Time to reboot and check again:

sudo reboot


Done. :)


If it did not work, you can check the links in the Sources section for all the resources that helped me getting it to work with my keyboard. (Ducky x Varmilo Miya Mac Moonlight [Varmilo Miya69-Mac]).

Many thanks to jpihl over at unix.stackexchange.com! There answer to an older question did the trick for me!: https://unix.stackexchange.com/a/609797



Sources: