Skip to content

Instantly share code, notes, and snippets.

@joepvd
Created February 27, 2019 08:33
Show Gist options
  • Save joepvd/7613bc944a76e353345c8e38e4cea9c9 to your computer and use it in GitHub Desktop.
Save joepvd/7613bc944a76e353345c8e38e4cea9c9 to your computer and use it in GitHub Desktop.
#!/bin/sh
# No more peck and hunt with xev!
# By Joep van Delft, github.com/joepvd
xev |
awk '
BEGIN {
FS="[ (),]+"
fmt = "%-7s %-4s %-6s %s\n"
printf fmt, "action", "code", "sym", "name"
printf fmt, "-------", "----", "------", "----"
}
/^KeyPress/ { action = "press" }
/^KeyRelease/ { action = "release" }
/keysym/ { printf fmt, action, $5, $7, $8 }
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment