# How do I configure the launcher to "dodge windows"?

I don’t like the auto hide launcher for it is too annoying for me. The launcher stays hidden and to reveal it, the mouse pointer has to be moved to the default hot spot. I’d instead like to have the hide to dodge windows previously available in Ubuntu 11.10. How do I change back to this behaviour?

new answer for 16.04 and 18.04:

The old script will not run because of some errors. I modified the original script and now it works. Here it is:

#!/bin/bash
#ps -ef | grep "$0" | grep -v "grep|$$|/bin/sh" | awk '!/awk/ {print$2}' | xargs -r kill

# gconftool-2 --type int --set "/apps/compiz-1/plugins/unityshell/screen0/options/launcher_hide_mode" 0
#
# Okay we have to use dconf now instead of gconftool-2 so do the following instead:
#
dconf write "/org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode" 0
# if [ "$DESKTOP_SESSION" != "ubuntu" ]; then exit 0; fi RACE=$(wmctrl -l | grep -c "DNDCollectionWindow|launcher|panel")
MAX_W=$(wmctrl -lG | awk '{if ($5 > max) { max = $5;}} END {print max}') MAX_H=$(wmctrl -lG | awk '{if ($6 > max) { max =$6;}} END {print max}')
LAUNCHER=$(wmctrl -lG | grep launcher | awk '{print$5}')
PANEL=$(wmctrl -lG | grep panel | awk '{print$6}')
WIDTH=$(expr$MAX_W - $LAUNCHER) HEIGHT=$(expr $MAX_H -$PANEL)

while true; do sleep 1

CURRENT=$(dconf read "/org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode") MAXIMIZED=$(wmctrl -lG | awk -v LAUNCHER=$LAUNCHER -v PANEL=$PANEL '$3==LAUNCHER &&$4==PANEL' | grep -c "$WIDTH$HEIGHT")
MAXIMIZED2=$(wmctrl -lG | grep -v "N/A" | awk -v PANEL=$PANEL '$3==0 &&$4==PANEL' | grep -c "$MAX_W$HEIGHT")

if [ "$MAXIMIZED" -eq "0" -a "$MAXIMIZED2" -eq "0" ]; then
if [ "$CURRENT" -ne "0" ]; then dconf write "/org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode" 0;fi else if [ "$CURRENT" -ne "1" ]; then
dconf write "/org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode" 1;fi
fi
done


Run the following commands to install the dependencies:

sudo apt update
sudo apt install dconf-cli wmctrl coreutils gawk


notes:

I had to disable the ps command check so you have to manually disable autohide.

Before you run the script, you must disable the "Auto-hide the Launcher" setting in:

system settings > Appearance > Behavior > Auto-hide the Launcher

Also, if you kill the script you will probably have to go into your settings to disable "Auto-hide the Launcher" before you start it back up.

Additionally, I find the best way to run the script is with an ampersand after the script so you don't have to keep a terminal open like in the following example:

./unity-dodge-maximized-windows &


Finally, if you run into unexpected behavior you can always issue a kill to stop the script:

sudo killall unity-dodge-maximized-windows


Answered by mchid on November 14, 2021

14.04

The PPA that was available in 12.10 and 13.04 has still not been updated for 13.10 or 14.04 as of this writing.

In my testing I have found that the "Dodge Windows" script (that would nearly restore the old behavior of the dodge windows) no longer works....when it is installed, the launcher hides constantly and changing the behavior in the System Settings does not work until the script is removed.

The "Dodge Maximized Windows" does still work with the same limitations that I mentioned in my answer for 13.10 with two others....

1. on some webpages the window will resize so that the launcher is visible, this seem to be related to specific webpages (ighome.com is the only one I've found so far) switching to any other open tabs will restore the window and hide the launcher again....(I use Firefox so this may be different for Chrome or other browsers)
2. When you minimize a maximized window, the launcher will remain hidden a long as the window is open - this was not the case before, (the launcher would return if the window was minimized to the launcher)

I will edit this answer at some later point if a better solution comes about or the current scripts are edited to work better.

Dodge maximized windows

The blog post about the PPA and the scripts that was written for 12.10 and 13.04 is

How To Get Unity Launcher Window Dodge In Ubuntu 12.10 Or 13.04

Answered by TrailRider on November 14, 2021

13.10

This is possible 13.10, at least it tested well in my VM.

The older scripts do not work as you(Seth) have discovered. However the newer scripts that worked for 12.10 and 13.04 work for 13.10.

The site webupd8.org has the instructions. As is stated, the instructions are for 12.10 and 13.04 but I tested the one in Virtualbox and it worked flawlessly(well as well as they did in 12.04 up, there are a few limitations as noted in the article but all in all they work well)

Unfortunately, the ppa for Saucy has not bee updated to include these scripts (at least not as far as I was able to determine) so the only solution is to download them directly.

There are 2 different scripts and they cannot be installed together.

The one script only dodges maximized windows. It's biggest limitation is that it will allow the launcher to overlap any windows that were opened while it was hidden.

The other script brings back the old style of dodging windows(almost) in that it will hide the launcher when any window is in it's(the launchers) space. The biggest limitation that I noticed is that if any window is open that is in the launcher's space, the launcher will stay hidden even if that window is minimized.

I would suggest that you read the article on webupd8.org that I linked to at it gives a good rundown of the scripts, (I don't want to get into plagiarism territory by including too much of the article.

In the interest of full disclosure, I did not play too long with the 13.10 VM but in the time I used it I didn’t notice any unexpected issues with the dodge windows scripts. I also did not play long at all(maybe an hour) with the "original" dodge windows script as the hidden launcher limitation I mentioned above was not to my liking. The dodge maximized windows script has seen maybe 10+ hours of use with success.

As an editorial note(read my opinion, which in worth exactly what you paid for it); These "dodge windows" question and workarounds are all over AU and the internet, I don't understand why Canonical is so married to the idea that it was a bad feature. Yes I have seen the articles about why they removed it and it seems like "thin soup" to me, obviously many user want it, and the scripts work well enough.

To give credit where it is due(I think*), I believe that @JorgeCastro wrote the first work-around script back in 12.04(the dodge maximized windows one). Thanks a bunch Jorge, this missing feature was a deal breaker for me and I was considering switching away from Unity(was considering Cinnamon but it was buggy, so you really saved me at least.)

I have taken a bit of a liberty in including this editorial, and my intention was not to start a discussion on the subject, just to state what seems to be a common opinion in the Ubuntu community. Please do not respond to this as a discussion, or I, or the mods will be forced to edit or delete this answer.

Answered by TrailRider on November 14, 2021

13.10

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo gedit '/etc/apt/sources.list.d/nilarimogard-webupd8-saucy.list'


make sure it looks like this

deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu raring main


This changes 'saucy' to 'raring'.

sudo apt-get update
sudo apt-get install unity-dodge-maximized-windows


Atlast reboot your pc to make changes(unity-dodge-maximized-windows) work.

Answered by mchid on November 14, 2021

### 12.04

In Ubuntu 12.04 the Dodge Windows feature was removed. To get it back you will have to install basically a patched version of Unity.

The easiest way is probably to read the following posts carefully and follow the instructions. There are two different kind of fixes and you'll have to settle for one.

Get Dodge Windows Unity Autohide Behaviour For Maximized Windows In Ubuntu 12.04 Precise Pangolin and Real Window Dodge Unity Launcher Bahaviour For Ubuntu 12.04, I presume you'd prefer the latter. I, however, understand that this is a custom build of Unity and cannot give any information about future updates (should unity receive updates), bug fixes etc.

You might also want to check out the original ubuntuforums thread that dealt with these issues: HOW-TO: Unity with 'Dodge Windows' and minimize/unminimize behavior

Answered by moewe on November 14, 2021

### 12.04

Unity 2D is the only way to have dodge in Precise out of the box. After logging in, open dconf-editor and navigate to /com/canonical/unity-2d/launcher/hide-mode and set its value to 2 (the default is 0).

Answered by papukaija on November 14, 2021

### 12.04

Here is the solution: https://help.ubuntu.com/community/Unity-ReplaceDodgeWindowsBehavior

have fun!

Answered by Kamil on November 14, 2021

### 12.04

this feature called dodge. was dropped from unity. there are unofficial solutions to get it back.

There are two window dodge behaviours available: one that works mostly as it used to be in Ubuntu 11.10 and the other one only works for maximized windows:

 real window dodge behaviour for the Unity Launcher and you can download it here:


 window dodge behaviour for maximized windows and you can download it here:


for further info please see the related section on this post.

Answered by suli8 on November 14, 2021

How to restore Dodge behavior in 12.04

This Ubuntu Geek post and this newer WepUpd8 post report how to restore the Dodge Windows and Dodge Active Windows for Unity in 12.04. These can then be set in the Unity plugin in CompizConfig Settings Manager. Update: For 12.10 / 13.04, please refer also to this WepUpd8 post.

It is required to add a ppa:

sudo apt-add-repository ppa:ikarosdev/unity-revamped


sudo apt-get update


Then open CCSM and set it to your favorite behavior!

(The terminal is only to document Ubuntu version.)

You might have to log out and in again for it to take effect.

This patch also restores the old Click-To-Minimize behavior. See this Webupd8 post for details.

All changes can be reverted by the following commands:

sudo apt-get install ppa-purge
sudo ppa-purge ppa:ikarosdev/unity-revamped


Alternatively, a hack to restore the older Dodge behavior is reported on here.

I tried out the "real dodge" version, and it works so-so in my opinion. Most notably, the launcher does not "go above" active windows, but pushes them to the side, where it sometimes gets stuck (so the launcher doesn't go away again). In general, when the launcher shifts position, so does many other things on screen (e.g., icons on the desktop).

An alternative is to (almost) permanently hide the launcher (see here) and use a dock with the wished for behavior (for example cairo-dock).

Answered by Rasmus on November 14, 2021

### 12.04

I'm afraid the dodge window capability was deliberately removed from 12.04

According to Mark Shuttleworth

"dodge-windows approach tested very poorly. We thought it would work well, tried it, tested it, and have had to evolve from there based on evidence....

If users encounter the dodge by moving windows against the launcher, then it is fine. They see that the dodge happens when they push the launcher away, they discover they can move the window back and the launcher will reappear. So far so good.

Here's the problem. Most users don't discover the dodging by moving a window till it touches the launcher. They first encounter it when they maximise a window. So, they login to the desktop. Good. They start an app. Good. Then they maximise a window, and the launcher "disappears". To these users, the behaviour is deeply uncomfortable, random. And these are in fact the majority of users. It also turns out that users who can work with dodging launchers can also work perfectly well with launchers which always hide when not used."

By default the launcher is always visible.

How can I configure Unity's launcher auto-hide behavior?

Dodge Windows is a topic covered by WebUpd8

An enterprising developer has written some scripts that mimic the dodge window behaviour when a window is moved into the launcher area - i.e. it hides and unhides as appropriate.

A similar script is available to autohide the launcher when a window is maximised.

Note - these are in binary deb format. Obviously - installing random binaries is not recommended practise from a security point. Read the article if you wish to pursue this.

Answered by fossfreedom on November 14, 2021

## Related Questions

### Kubuntu 20.04 how to run script to keep VRAM on P-State 2

0  Asked on August 4, 2020 by userdepth

### Frontend for TTS – Ubuntu 20.04

0  Asked on August 4, 2020 by nikol

### Setting PATH variable for Android Studio Correctly

1  Asked on August 2, 2020 by manu-mathur

### Mic device not working on Ubuntu 18.04

1  Asked on August 2, 2020 by nicollas-soares

### Validity VFS301 Fingerprint Reader – Ubuntu 20.04

0  Asked on July 28, 2020 by julio-ortiz