Created
April 5, 2018 04:50
-
-
Save fredcamps/7abc2dd0aef080f730746a6e5b05b2d3 to your computer and use it in GitHub Desktop.
~/.local/bin/emacs-xfce4-hotkeys
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 | |
# ~/.local/bin/emacs-xfce4-hotkeys | |
# | |
# | |
OPTION=/Gtk/KeyThemeName | |
function run_command { | |
xfconf-query -c xsettings -p "${OPTION}" -s "$1" | |
} | |
function off { | |
echo "> Turning off emacs-keys..." | |
run_command Default | |
echo "> Done" | |
} | |
function on { | |
echo "> Turning on emacs-keys..." | |
run_command Emacs | |
echo "> Done" | |
} | |
function switch { | |
value=$(xfconf-query -c xsettings -p "${OPTION}" -v) | |
if [ "${value}" == Emacs ]; then | |
off | |
else | |
on | |
fi | |
} | |
switch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment