Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Last active July 31, 2021 23:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwilczynski/2c98aad4e6205fea31fdb744889e4512 to your computer and use it in GitHub Desktop.
Save kwilczynski/2c98aad4e6205fea31fdb744889e4512 to your computer and use it in GitHub Desktop.
Install the "xdotool" utility as usual on Ubuntu, then go to "/lib/systemd/system-sleep"
directory and create a small shell script called "capslock" with the following content:
#!/bin/sh
case "$1" in
post)
/usr/bin/logger -t suspend -s 'Resetting CapsLock key'
/usr/bin/xdotool --clearmodifiers --delay 500 --repeat 2 Caps_Lock
;;
esac
Make sure to make it executable and should be owner by the root user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment