Unity – Shortcut to Change Launcher ‘Hide’ Setting

compizlauncherunity

When I'm working on my laptop I have periods that I am only using a couple of programs, so the default intellihide setting of the Launcher ('Dodge windows') is very handy. But I also have periods that I have to switch very often between programs, and then I find it very useful (and better for my workflow) that the Launcher doesn't hide.

Now, every time I wan't to switch I have to open CCSM and change the setting (Unity plugin -> Hide Launcher), but it would be easier if I could use a shortcut for it. So my question:

Is there a way to create a shortcut to switch between (or change) the two settings of Compiz?

I thought of command line interface to compiz, but I couldn't directly find something like that.

Best Answer

You can run

gconftool-2 --type int --set "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode" 2

to set the launcher hide mode to "Dodge Windows", and

gconftool-2 --type int --set "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode" 0

to set it to never hide.

The mode numbers are:

  • 0 - Never
  • 1 - Autohide
  • 2 - Dodge Windows
  • 3 - Dodge Active Window

You can make this a switch by just calling (the value must be 2 or 0 before):

gconftool-2 --type int --set "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode" $((2 - $(gconftool-2 --get "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode")))

You then would create a new keybinding (Alt + F2gnome-keybinding-properties) with the command being:

/bin/bash -c "gconftool-2 --type int --set "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode" $((2 - $(gconftool-2 --get "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode")))"
Related Question