Last active
March 26, 2016 21:01
-
-
Save crawsible/13b7b4d152ce0b5f8983 to your computer and use it in GitHub Desktop.
A script for toggling the alt/win keyboard swap in GNOME settings.
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
#!/usr/bin/env bash | |
OLD_KBOPTS=`gsettings get org.gnome.libgnomekbd.keyboard options` | |
TOGGLE_OP="altwin\taltwin:swap_alt_win" | |
if [[ $OLD_KBOPTS == *"$TOGGLE_OP"* ]] | |
then | |
OP="-" | |
echo "Unswapping alt and win..." | |
else | |
OP="+" | |
echo "Swapping alt and win..." | |
fi | |
NEW_KBOPTS=`echo $OLD_KBOPTS | sed "s/'/\"/g" | jq ". |= .$OP[\"$TOGGLE_OP\"]" | sed "s/\"/'/g"` | |
gsettings set org.gnome.libgnomekbd.keyboard options "$NEW_KBOPTS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment