I was trying to control Ubuntu 14.4.1 Launcher's behavior. I want it to auto-hide every time I have browser window like firefox maxmaized. I found this solution:
#!/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;
but is seems too old to work then I found this
I tried to combine the two scripts together so here is what I did:
#!/bin/bash
AUTOHIDE=$(dconf read /org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode)
if [[ $AUTOHIDE -eq 1 ]]
then
dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode 0
else
dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode 1
fi
## 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;
But script doesn't work. can anybody refine this script to me and get it to work?