I want to hide launcher only when google chrome is running. How can I do that?
2 Answers
First of all, it is so import to know which command works for you to hide/show the panel, since the command differs between Ubuntu versions. Execute these commands one by one and note down the command which hides your panel:
I'm using Ubuntu 12.04 with Unity 2D and these works for me:
# hide
gsettings set com.canonical.Unity2d.Launcher hide-mode 1
# show
gsettings set com.canonical.Unity2d.Launcher hide-mode 0
For Ubuntu 12.10 (check this question also):
# hide
gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ launcher-hide-mode 1
# show
gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ launcher-hide-mode 0
` Probably for others if above doesn't work(check this question also)
# hide
gconftool-2 --type int --set "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode" 1
# show
gconftool-2 --type int --set "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode" 0
Now follow these simple steps:
Install
wmctrl
package:sudo apt-get install wmctrl
Make a script file. Paste the following in a file and give the file any name, say
autohide
:#!/bin/bash ## Change value of "hide" to the command which worked for you to hide the panel hide='gsettings set com.canonical.Unity2d.Launcher hide-mode 1;' ## Change value of "show" to the command which worked for you to show the panel when it was hidden show='gsettings set com.canonical.Unity2d.Launcher hide-mode 0;' ## Look for the grep value, add a new browser or application name followed by "\|" eg: 'firefox\|google\|chromium' while [ 1 ] do z=$(wmctrl -l -p | grep -i 'firefox\|google'); if [ -n "$z" ]; then eval $hide else eval $show fi; sleep 2; done;
Make the file executable:
chmod +x autohide
Execute the file:
./autohide
That's it. Now whenever you open firefox or chrome, it will hide the panel and when you close, the panel will be shown.
You can also make this script execute every time you start your system.
- See this question: How do I start applications automatically on login?

- 70,465

- 14,916
It is possible:
Though this may not be a perfect way of doing this but it should work:
This is the command which can change your unity launcher settings:
gconftool-2 --type int --set "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode" 2
The last 2 comes from here:
The mode numbers:
- 0 - Never
- 1 - Autohide
- 2 - Dodge Windows
- 3 - Dodge Active Window
So now go to /usr/bin
You need to edit the google-chrome
executable:
sudo emacs /usr/bin/google-chrome
At the start add this line:
gconftool-2 --type int --set "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode" 1
So whenever you start your google-chrome this line is executed and your launcher will get to Autohide mode
I don't know if any script is executed when google-chrom exits..so you may need to reset the changes manually using this line:
gconftool-2 --type int --set "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode" 0
Hope this helps!

- 2,547
- 5
- 26
- 38
-
you may want to check out links provided by Sauvrav Kumar – Null pointer Feb 06 '14 at 11:53
-
yeah! your answer is good but your answer doesn't automate the process! It won't work on its own when chrome is started which happens with my answer.. – Null pointer Feb 06 '14 at 11:54