Skip to content

Instantly share code, notes, and snippets.

@ninrod
Forked from berkes/swapesc
Created May 3, 2017 03:21
Show Gist options
  • Save ninrod/f5435c70b8b1558957800c25f3a4474a to your computer and use it in GitHub Desktop.
Save ninrod/f5435c70b8b1558957800c25f3a4474a to your computer and use it in GitHub Desktop.
#!/bin/bash
current=$(dconf read /org/gnome/desktop/input-sources/xkb-options)
swapped="['caps:swapescape']"
capslock="['caps:capslock']"
echo "Current status: $current"
if [ "$current" == "$swapped" ]
then
echo "Making caps and escape WORK NORMALLY"
dconf write /org/gnome/desktop/input-sources/xkb-options $capslock
elif [ "$current" == "$capslock" ]
then
echo "Swapping caps and escape"
dconf write /org/gnome/desktop/input-sources/xkb-options $swapped
else
echo "caps is not swapescaped nor capslock. Doing nothing."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment