Skip to content

Instantly share code, notes, and snippets.

@ryukinix
Created August 24, 2015 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ryukinix/6b7748894f60a0f3af6b to your computer and use it in GitHub Desktop.
Save ryukinix/6b7748894f60a0f3af6b to your computer and use it in GitHub Desktop.
A command to get the keycodes of your keyboard and configure your ~/.Xmodmap
#!/usr/bin/env bash
# A command to get the keycodes of your keyboard and configure your ~/.Xmodmap
# I used that for configure my multimedia-keys on XFCE4 @ Manjaro
xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
# [e.g.: ~/.Xmodmap
# keycode 162 = XF86AudioPlay
# keycode 164 = XF86AudioStop
# keycode 160 = XF86AudioMute
# keycode 144 = XF86AudioPrev
# keycode 153 = XF86AudioNext
# keycode 176 = XF86AudioRaiseVolume
# keycode 174 = XF86AudioLowerVolume
# keycode 237 = XF86AudioMedia
# keycode 230 = XF86Favorites
# keycode 236 = XF86Mail
# keycode 178 = XF86WWW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment