Compose key and i3
The compose key on Linux and other systems enables you to enter symbols like ™ that don't have a dedicated key on most keyboards. GNOME makes this easy to do via Gnome Tweaks. However, using a window manager like i3 means there's no dedicated GUI for changing the hotkey for compose.
This stackexchange answer sent me down the right path of adding the following config to ~/.Xmodmap
to bind Caps lock to compose:
.keysym 66 = Mode_switch clear Lock
You can then enable the key map by running:
xmodmap ~/.Xmodmap
However, that config didn't work because Mode_switch
wasn't the right name for the compose key (at least under Ubuntu/PopOS 20 for me). The Arch Wiki states that the name for the compose key is actually Multi_key
. With this new name I was able to get Caps lock to act as the compose key by updating the config in ~/.Xmodmap
to:
keycode 66 = Multi_key clear Lock
The final step is to set that mapping every time i3 runs by putting this inside your i3 config file like so:
exec --no-startup-id "xmodmap ~/.Xmodmap"