ghkd is a fast, kernel-level hotkey daemon for Linux.
Unlike compositor-bound solutions, ghkd reads input directly from evdev, allowing global hotkeys that work everywhere:
- Wayland compositors
- X11 environments
- Desktop environments
- TTY console sessions
No compositor configs. No display server coupling.
- 🖥 Display Server Agnostic — Wayland, X11, or no GUI
- ⚡ Kernel-Level Input — reads directly from
/dev/input - 🧱 Zero Dependencies — pure Go binary
- 🔁 Hot Reload — update config without restarting
- 🧠 Smart Device Detection — ignores mice & peripherals
- 🔧 Daemon Management — built-in background control
| Mode | Description |
|---|---|
| Run | Execute commands directly |
| Script | Inline Bash/Python/Node/Ruby scripts |
| File | Execute external scripts |
git clone https://github.com/glowfi/ghkd.git
cd ghkd
go build -o ghkd ./main.go
sudo mv ghkd /usr/local/bin/wget https://github.com/glowfi/ghkd/releases/download/v1.0.0/ghkd_linux_amd64
chmod +x ghkd_linux_amd64
sudo mv ghkd_linux_amd64 /usr/local/bin/ghkdghkd accesses hardware input devices.
Add your user to the input group:
sudo usermod -aG input $USERThen log out or reboot.
Create:
~/.config/ghkd/config.yaml
- Exactly one main key per binding
- Unlimited modifier keys allowed
- Case-insensitive syntax
- Keys joined using
+
Full reference: https://raw.githubusercontent.com/glowfi/ghkd/main/internal/hotkey/keymap.go
| Category | Examples |
|---|---|
| Modifiers | ctrl, alt, shift, super |
| Standard | a-z, 0-9, f1-f24 |
| Navigation | left, right, home, end |
| Special | enter, space, esc, tab |
| Media | volumeup, mute, brightnessup |
keybindings:
- name: Terminal
keys: ctrl+alt+t
run: alacritty
- name: Volume Up
keys: volumeup
run: pactl set-sink-volume @DEFAULT_SINK@ +5%
- name: System Info
keys: super+i
interpreter: python3
script: |
import platform
print(platform.system())
- name: Screenshot
keys: meta+print
interpreter: bash
script: |
file="$HOME/Pictures/screen-$(date +%s).png"
grim "$file"
notify-send "Screenshot taken"
- name: Backup
keys: super+b
file: ~/scripts/backup.sh| Flag | Description |
|---|---|
-b, --background |
Run daemon in background |
-r, --reload |
Reload configuration |
-k, --kill |
Stop running instance |
-c, --config |
Custom config path |
-v, --version |
Show version |
ghkd -b -c ~/.config/ghkd/config.yamlEnsure your user belongs to input group:
groupsReboot after adding.
Check kernel device detection:
cat /proc/bus/input/devicesghkd -k(removes stale lock file)
- Universal hotkeys
- Minimal runtime overhead
- Display-server independence
- Predictable configuration
- System-level reliability
Issues and PRs are welcome.
Small focused contributions preferred.
GPL-3.0
