Change F keys in Linux
In case anyone hasn’t noticed yet. The function keys F1 to F12 are in total decay.
With reduced keyboards (60% of keys), and with volumnen, brightness, playback functionalities taking priority, there is still a large segment of users who find them inconvenient. For me, for example, simply using F2 to rename a file is more important than controlling the brightness of my screen. For all of us, for all of us who need the default function keys to be just that, the following note is important.
echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
With this simple command, the function of the function keys will return to what it should never have been. Even if your keyboard is not Apple, it will still work.
Update
If we want this change to persist after reboots, we have to create the file /etc/modprobe.d/hid_apple.conf with the following content:
options hid_apple fnmode=2
Ready, enjoy!