Last active
January 4, 2016 01:59
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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