lunes, 9 de enero de 2012

On yakuake in gnome

Note: I know this blog is called Notes on Using Python, but i'll also do random posts on using linux.

Yakuake its hands down the best drop down terminal emulator on Linux, but it can be tricky to get it to play nice with gnome.

THE PROBLEM
The behavior should be this:
  1. I hit my yakuake hotkeys(defined in the yakuake shortcut settings) and yakuake toggles between hidden or shown.
  2. I hit my show desktop hotkey and it toggles all the windows off and on.
Right now this happens
  1. I hit my yakuake hotkeys(defined in the yakuake shortcut settings) and yakuake does nothing.
  2. If yakuake is being show if i hit my showdesktop hotkey, yakuake ignores it and remains.
THE SOLUTION
My solution involves
Dont set a hotkey in the yakuake shortcut settings(delete any shortcuts)
Set a hotkey using the keyboard shortcuts gnome system application: adding a new shortcut that runs the command yakuake, to my desired hotkey.
To fix the show desktop im using wmctrl, which you can get using a simple:
sudo apt-get install wmctrl
Then create the file showdesktop
sudo gedit /usr/local/bin/showdesktop
Paste this content into the file and save it
#!/bin/sh
if wmctrl -m | grep "mode: ON"; then
    wmctrl -k off
    if ! wmctrl -l | grep Yakuake; then
        yakuake
    fi
else
    wmctrl -k on
    if wmctrl -l | grep Yakuake; then
        yakuake
    fi
fi
Give it permission to run
sudo chmod +x /usr/local/bin/showdesktop
And then go again to the keyboard shortcuts gnome system application and add a new shortcut that simply runs showdesktop.
Boom, now all works as expected.

No hay comentarios:

Publicar un comentario