Mac – Tips and Tricks

How to use F13, F14, F15.. F19 keys in Rocky Linux session

First you need to dump your currently Xmoadmapp:

xmodmap -pke > .Xmodmap

Then you need to edit it and set:

keycode 191 = F13 F13 F13 F13
keycode 192 = F14 F14 F14 F14
keycode 193 = F15 F15 F15 F15

And you can add others (F16..n up to F19) you need to check the respective keycodes.

You need to edit the file /usr/share/X11/xkb/symbols/inet in the Rock Linux host and add this entries:

partial alphanumeric_keys
xkb_symbols "fnkeys" {
key { [ F13 ] };
key { [ F14 ] };
key { [ F15 ] };
key { [ F16 ] };
key { [ F17 ] };
key { [ F18 ] };
key { [ F19 ] };
};

Create this script to be executed during Linux login (suppose that you will store in ~/setxkbmap-layout.sh):

#!/bin/bash
setxkbmap -layout us -symbols "pc+us+inet(evdev)+inet(fnkeys)"

And configure the script to be executed in the .config/autostart/setxkbmap-layout.desktop user file:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Keybinding
Comment=Keybinding
Exec=bash -c "source ~/setxkbmap-layout.sh"
Terminal=false