Skip to content

Instantly share code, notes, and snippets.

@dhorlick
Created September 5, 2025 14:25
Show Gist options
  • Select an option

  • Save dhorlick/a53088c22d12c7c8b0530e2cb4f5a6e3 to your computer and use it in GitHub Desktop.

Select an option

Save dhorlick/a53088c22d12c7c8b0530e2cb4f5a6e3 to your computer and use it in GitHub Desktop.
Mod wayland to map shifted function keys to interesting characters
# Below for use with https://gist.github.com/dhorlick/f42133baab48ca7be8520e3c761a2bb9
# If you're using Wayland (Ubuntu 21 and later, and also maybe 17?), you'll need to copy the keyboard symbol file to ~/.config/xkb/symbols/ and edit it there. (The location could be different, if you've set XDG_HOME_CONFIG to something else)
# Here was what I added inside xkb_symbols "basic":
key <FK01> { [ F1, U2026 ] }; # horizontal ellipsis
key <FK02> { [ F2, U22EE ] }; # vertical ellipsis
key <FK03> { [ F3, U00D7 ] }; # multiplication sign
key <FK04> { [ F4, U2192 ] }; # rightwards arrow
key <FK05> { [ F5, U266A ] }; # eighth note
key <FK06> { [ F6, U2126 ] }; # Ohm
key <FK07> { [ F7, U02BB ] }; # okina
key <FK08> { [ F8, U262E ] }; # peace symbol
key <FK09> { [ F9, U2713 ] }; # check mark
key <FK10> { [ F10, U2020 ] }; # dagger
key <FK11> { [ F11, U263A ] }; # smiley face
key <FK12> { [ F12, U2639 ] }; # frowning face
# Where the left side of each line is the key to remap, the first item within the brackets is the unshifted target (in this case, the same key), and the second item within the brackets is the shifted target (in this case, the hexadecimal index of a unicode character.)
# This worked great, with the caveat that unicode characters bearing hex indices of greater than 4 digits caused serious problems. My workaround was not to use any :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment