Remap keys system-wide with keyd, including the TTY and login screen
The mechanism and the config format are right, the Omarchy 4 specialisation and the danger are wrong. Confirmed correct against keyd's own docs at rvaiya/keyd master: the config must begin with an [ids] section, * matches every device keyd identifies as a keyboard, [main] is the base layer, capslock = overload(control, esc) is upstream's own first example, and sudo keyd reload is the documented reload. Packaging checked against archlinux.org: keyd is in extra at 2.6.0-5, not the AUR, and the unit really is keyd.service in usr/lib/systemd/system/. pacman -Q keyd fails on this workstation, so keyd is not installed here and nothing below was exercised live. sudo pacman -S keyd is not blocked on Omarchy: /usr/bin/omarchy-update-pacman-guard aborts only when the pacman command line carries both a sync and a sysupgrade flag, so a plain install passes. Three defects. (1) The flagship example collides head on with Omarchy 4. /usr/share/omarchy/default/hypr/input.lua line 37 sets kb_options = "compose:caps,shift:both_capslock_cancel", so on Omarchy Caps Lock is already the Compose key and Caps Lock itself lives on both Shifts. hyprctl -j devices on this machine confirms it: every keyboard reports options: compose:caps,shift:both_capslock_cancel. A keyd [main] that turns capslock into control and esc means the compositor never sees the Caps Lock keycode, which kills Compose, kills ~/.XCompose, and makes /usr/lib/systemd/user/omarchy-fcitx5.service pointless, since that unit's stated job is exactly to turn CapsLock compose sequences into text. The record says nothing about this. (2) The Hyprland-only alternative replaces rather than extends. ~/.config/hypr/input.lua is loaded after Omarchy's defaults and its own header says uncommented settings replace them, and its commented kb_options example keeps compose:caps,shift:both_capslock_cancel as a prefix. The record's kb_options = "caps:ctrl_modifier" would silently drop both. It also does not say which file to put it in. (3) The danger names a recovery route that does not work. keyd's README states the escape hatch plainly: backspace+escape+enter terminates keyd. The record omits it and instead suggests a spare USB keyboard, which under [ids] * is grabbed too and helps with nothing, and sudo systemctl stop keyd, which needs a keyboard you no longer have. Worth knowing for this machine specifically: the README warns that mice emitting keys are matched by the wildcard and may need blacklisting, and hyprctl devices here lists corsair-corsair-gaming-k55-rgb-keyboard-1 and razer-razer-basilisk-v3-keyboard under mice, so the composite-device case is live on this hardware. On the compositor interaction: keyd works below Hyprland by grabbing evdev and emitting through uinput, so Hyprland's xkb options apply on top of keyd's output rather than instead of it, and the two stack. I did not install keyd, did not write any file under /etc/keyd, did not start the unit and did not run keyd monitor. Severity stays low because the underlying want is a preference. Frequency is unchanged. Sources all resolve and all say what is cited, so nothing is removed.
keyd runs as root and grabs your keyboards, so a bad config can leave you with no way to type, including at the TTY and the greeter. **Learn the escape hatch before you start**: keyd's own documentation says the key sequence backspace+escape+enter causes keyd to terminate. That is the only recovery that works when the keyboard is the thing that is broken. A spare USB keyboard does not help under [ids] *, because keyd grabs that one too, and sudo systemctl stop keyd needs a keyboard you no longer have or a second machine already logged in over ssh. Open an ssh session from another machine before you enable the unit, and keep it open while you test. On Omarchy 4 there is a second cost: a rule that consumes Caps Lock removes the Compose key that kb_options = "compose:caps" and omarchy-fcitx5.service depend on, so ~/.XCompose sequences stop producing characters.
Symptom
You want Caps Lock as Ctrl/Escape, a home-row mod layer, or media keys remapped, and it must work everywhere: in Hyprland, in the TTY, on the SDDM/greeter login screen, and inside XWayland games. setxkbmap/xmodmap do nothing on Wayland, and Hyprland's kb_options only covers the compositor session, not the TTY or the display manager.
Cause
Hyprland's XKB settings are applied by the compositor to its own clients only. Anything outside the compositor session (virtual console, greeter, early boot) never sees them. Remapping below the compositor requires a kernel-level evdev/uinput daemon.
Fix
keyd is in extra, so no AUR helper is needed. The Omarchy update guard only blocks a combined sync and sysupgrade, so a plain install is fine:
sudo pacman -S keyd
**Before you write a config on Omarchy 4, know what Caps Lock already does.** /usr/share/omarchy/default/hypr/input.lua sets:
kb_options = "compose:caps,shift:both_capslock_cancel"
So Caps Lock is the Compose key, Caps Lock itself is on both Shifts together, and omarchy-fcitx5.service exists to turn those compose sequences from ~/.XCompose into text. Confirm on your own machine:
hyprctl -j devices | grep -m1 options
keyd sits below the compositor, so a rule that consumes Caps Lock means Hyprland never sees that keycode and Compose stops working. Pick a key Omarchy has not claimed, or accept losing Compose and say so to yourself first. This example leaves Caps Lock alone:
# /etc/keyd/default.conf
[ids]
*
[main]
# Swap left alt and left meta.
leftalt = leftmeta
leftmeta = leftalt
# Right alt becomes tap for Escape, hold for Control.
rightalt = overload(control, esc)
On **plain Arch**, where nothing owns Caps Lock, upstream's own example is the usual one:
[main]
capslock = overload(control, esc)
Enable and load it:
sudo systemctl enable --now keyd
sudo keyd reload
Watch what keyd produces while you test, and read the log if a config is rejected:
sudo keyd monitor
sudo journalctl -eu keyd
The remap now applies in Hyprland, in XWayland apps, at the greeter and in the TTY, because it happens before anything reads the device. Hyprland's own xkb options still apply on top of keyd's output, so the two stack rather than replacing each other.
**Watch the wildcard.** * matches every device keyd treats as a keyboard, and gaming mice and keyboard-equipped peripherals often qualify. hyprctl devices on this workstation lists corsair-corsair-gaming-k55-rgb-keyboard-1 and razer-razer-basilisk-v3-keyboard under mice. Get ids from sudo keyd monitor and exclude what you do not want:
[ids]
*
-1532:00a6
If you only need the remap inside the Hyprland session, prefer the compositor setting. It is simpler and has no root daemon. **On Omarchy 4 it goes in ~/.config/hypr/input.lua, which is loaded after Omarchy's defaults and replaces them wholesale**, so repeat the options you want to keep:
-- ~/.config/hypr/input.lua
hl.config({
input = {
kb_options = "compose:caps,shift:both_capslock_cancel,altwin:swap_lalt_lwin",
},
})
Writing kb_options = "caps:ctrl_modifier" on its own there drops Compose and the both-Shifts Caps Lock. It also fights compose:caps, because both want Caps Lock.
Verify
sudo keyd monitor shows the remapped keysym, and the remap still works after switching to a TTY with Ctrl+Alt+F3. If nothing changes, read sudo journalctl -eu keyd for a config parse error, since keyd reports those to the journal rather than to the terminal. On Omarchy 4, also confirm you did not lose Compose: press Caps Lock followed by a sequence from ~/.XCompose and check the character still arrives.
Sources
- https://wiki.archlinux.org/title/Input_remap_utilities
- https://wiki.archlinux.org/title/Keyboard_input
- https://wiki.hypr.land/Configuring/Basics/Variables/
- https://github.com/rvaiya/keyd/blob/master/README.md
- https://github.com/rvaiya/keyd/blob/master/docs/keyd.scdoc
- https://archlinux.org/packages/extra/x86_64/keyd/