My laptop is running Linux Mint 17 XFCE Edition, and I'm trying to set it up so that I can use Emacs with my usual keybindings. These include certain autocompletion/fill commands involving Alt-Tab, and at present the OS's Alt-Tab and Shift-Alt-Tab application switcher intercepts any commands I try to use including these keys.

I would like to be able to run some kind of monitor script that detects when Emacs is running (or focused, even), disables both Alt-Tab and Shift-Alt-Tab shortcuts, and then resets them once emacs is no longer running.

My Attempted Solution: Based on a wonderful answer I received over at AskUbuntu to a related question using gsettings, I thought I'd try the following:


disabled="0" # Track whether or not <Alt>Tab and <Alt><Shift>Tab are currently disabled

while true; do
    isActive=$(wmctrl -lx | awk -v search=$(printf 0x0%x $(xdotool getactivewindow)) -v wm_class="$wm_class" '{ if($1 ~ search && $3 ~ /emacs/) print $3 }')

    if [[ "$isActive" != "" ]]; then
        # echo "active"
        if [[ "$disabled" == "0" ]]; then
            # echo "disable shortcuts"
            xfconf-query -c xfce4-keyboard-shortcuts -p "/xfwm4/custom/<Alt>Tab" -s ""
            xfconf-query -c xfce4-keyboard-shortcuts -p "/xfwm4/custom/<Alt><Shift>Tab" -s ""
        # echo "not active"
        if [[ "$disabled" == "1" ]]; then
            # echo "enable shortcuts"
            xfconf-query -c xfce4-keyboard-shortcuts -p "/xfwm4/custom/<Alt>Tab" -r
            xfconf-query -c xfce4-keyboard-shortcuts -p "/xfwm4/custom/<Alt><Shift>Tab" -r
    sleep 1


While this does seem to set/reset the relevant keybinding settings, these settings won't take effect until I log out and log back in, which sort of defeats the purpose of this script. Is there some other command I need to run in order to get XFCE to process its keybinding settings after making changes? Should I not be setting the keybindings to empty strings to disable them? Or is there something else I'm missing here?

I'm hoping/assuming there's a way to do this without having to log out/log back in, since that would definitely be more trouble than it's worth here.

Thanks in advance for any help you can provide!

2 Answers 2


If those settings are not applied, than your desktop is broken.

Is xfsettingsd running and reacting? Is xfwm4 running and reacting?

Join me in IRC for live help


I found another solution after trying to copy my shortcuts / key mapping from one desktop to another :

  • run killall xfconfd
  • copy your XFCE config file to /home/$USER/.config/xfce4
  • open Keyboard settings > Application Shortcuts , ensure that the new shortcuts are shown there, make any change to force XFCE to reload the settings files, undo the change (if you want) then your new settings should be loaded now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .