Show to change the Apple keyboard Fn/Command/Option behavior on a Macbook Pro via the kernel module

Heres the steps to change the behaviour of the Macbook Pro keyboard via the hid_apple kernel module.

  1. Check if the kernel module is loaded and then the supported parameters :
lsmod | grep -i apple # Make sure hid_apple is loaded
modinfo -p hid_apple
  1. Open /etc/modprobe.d/hid_apple.conf with your favorite editor e.g nano, vim and insert the following:
# Fn when pressed down F1-12 by default,swap FN and Left Ctrl, swap Option/Command
options hid_apple fnmode=2 swap_fn_leftctrl=1 swap_opt_cmd=1
  1. Regenerate the initramfs and reboot:
sudo dracut -f
sudo reboot

Rollback:

sudo rm /etc/modprobe.d/hid_apple.conf
sudo dracut -f
sudo reboot