Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@trustin
Last active January 4, 2016 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trustin/8552089 to your computer and use it in GitHub Desktop.
Save trustin/8552089 to your computer and use it in GitHub Desktop.
A simple scripts that turns 'Ctrl' into 'Super' key in X. It also reverts the changes made by your desktop environment by monitoring xkbmap periodically.
#/bin/bash
# 0 - Init, 1 - Set XKBMAP
KBD_STATUS=0
while true; do
KBD_OPT='caps:super,terminate:ctrl_alt_bksp'
if [[ $KBD_STATUS -eq 1 ]]; then
setxkbmap -query | grep -qF "$KBD_OPT" || ((KBD_STATUS=0))
fi
if [[ $KBD_STATUS -ne 1 ]]; then
setxkbmap -option
setxkbmap -option "$KBD_OPT"
((KBD_STATUS=1))
fi
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment