Skip to content

Instantly share code, notes, and snippets.

@fredcamps
Created April 5, 2018 04:50
Show Gist options
  • Save fredcamps/7abc2dd0aef080f730746a6e5b05b2d3 to your computer and use it in GitHub Desktop.
Save fredcamps/7abc2dd0aef080f730746a6e5b05b2d3 to your computer and use it in GitHub Desktop.
~/.local/bin/emacs-xfce4-hotkeys
#!/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