Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
Command line for changing Compiz settings: wiki.compiz.org/Plugins/Dbus But coding a switch for this you need someone else ;) (maybe leave a q on their wiki?) –  Rinzwind May 8 '11 at 11:26
add comment

3 Answers 3

up vote 7 down vote accepted

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")))"
share|improve this answer
    
Thank you very much, exactly what I wanted! The call for switching works perfect. –  joris May 8 '11 at 12:55
    
But a question: I tried to map it to 'Super + H', but that doesn't work. However, with 'Ctrl + Alt + H' it works fine. Is there a reason for that? –  joris May 8 '11 at 13:06
    
It's probably because the Super key is used for Unity shortcuts of all sorts (hopefully that will be customizable in Ubuntu 11.10). –  htorque May 8 '11 at 13:12
    
This doesn't seem to work in 13.04, or am I doing something wrong? –  user138784 May 8 '13 at 9:21
add comment

For Unity

The command to make the launcher autohide:

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

And the command to make it never hide:

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

For Unity-2D

To autohide launcher:

gsettings set com.canonical.Unity2d.Launcher hide-mode 1

To never hide launcher:

gsettings set com.canonical.Unity2d.Launcher hide-mode 0
share|improve this answer
    
Hmmmm, this seems correct but the changes don't seem to apply unless I open up the launcher settings window. Any idea what's up with that? –  Joe May 6 '12 at 1:47
    
@Joe No idea. If I set a keyboard shortcut, it seems to adjust the value. I don't know why the launcher is not reacting though. :( –  jokerdino May 6 '12 at 1:59
add comment

I created an application indicator called Unity Launcher Toggle that lets you switch between launcher modes. http://napdivad.com/unity_launcher_toggle/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.