Is it possible to remove "Show Desktop" from the Alt+Tab application switcher?
-
You are using Unity, correct? – Knowledge Cube Jul 24 '12 at 05:04
-
1Yes, sorry, should have specified. I went to the Unity settings in CompizConfig but didn't find any visible option for that. Just wondering if there is a hidden option or if it's just simply somewhere else. – David Dossot Jul 24 '12 at 06:13
-
1You are correct; I couldn't find it there, either. I'm not sure if there might be another way to go about it, however. – Knowledge Cube Jul 26 '12 at 13:36
7 Answers
13.04 and newer
For 13.04, 13.10 and 14.04, to enable or disable the "Show desktop" option in application switcher you can use unity-tweak-tool
12.10
For 12.10, a new setting has been added to CCSM to enable or disable the "Show desktop" option in application switcher.
Run this command in a terminal to install CCSM:
sudo apt-get install compizconfig-settings-manager
Now open CCSM and go to Ubuntu Unity plugin.
Switch to Switcher tab. Then tick the check box next to Disable Show Desktop in the switcher option.
-
Thank you. I've disabled it using Unity Tweak Tool but your response sent me there. Ubunt 13.10.(Disabled it because sometimes it switches to Desktop) – adi Oct 26 '13 at 09:06
-
-
3
-
-
2
-
-
1
-
It can be done!
I've uploaded a Unity build for 12.04 that fixes this (no Show Desktop in the Alt-Tab switcher).
- To install, open a terminal and:
sudo apt-add-repository ppa:izx/askubuntu -y sudo apt-get update sudo apt-get install unity
You can enable the "Show Desktop Icon" setting in the Unity Plugin in Compiz (using
ccsm
) to get the icon on the Launcher on the left:If/when a new Unity update is released, Update Manager will download it automatically. I will try to "fix" the update and put it in the PPA as soon as possible; please add a comment to this answer to alert me if you upgrade and "Show Desktop" re-appears in the Switcher!
How did you do it?
I modified the Unity Source. It consists of two steps:
- Comment out line 900 in
plugins/unityshell/src/LauncherController.cpp
, which by default adds the "Show Desktop" icon to the switcher:
// results.push_back(pimpl->desktop_icon_);
Change line 1638 in
plugins/unityshell/src/unityshell.cpp
from:if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::TYPE_DESKTOP))
to
if (!results.size() == 0))
- While the list of Alt-Tab switcher icons was at least 1 before (the show-desktop icon), now it is 0 and we need to modify this to show the switcher only when there is at least one item in the list (i.e. at least one app running).

- 139,926
-
It looks like the current version of unity is 5.20, and your version is 5.14. I'm using 12.04, so a custom build seems to be my only option. Thanks for outlining this. If you don't have time to do the build, maybe I'll try it. – isaaclw Nov 30 '13 at 15:18
-
I spent some time and recompiled it myself for 5.20. I've posted my answer below, since it wasn't quite as straight forward as I imagined: http://askubuntu.com/a/395031/17065 – isaaclw Dec 24 '13 at 04:22
-
-
In 14.04, I was able to accomplish this in CompizConfig Settings Manager.
sudo apt-get install compizconfig-settings-manager
By visiting:
- "Desktop" section of the listing in the wide, white, right area →
- "Ubuntu Unity Plugin" item →
- "Switcher" tab →
- "Disable Show Desktop in the Switcher" item.
This was a default, uncustomized C.C.S.M. straight from the repos.

- 41,320

- 91
- 1
- 2
So, I'm not sure if this is of any help to you, however while using Unity 2D, sick of not having graphics drivers I dived into gnome fall-back. Then unsatisfied, I left back to the Unity interface. I no longer have the displayed "Show Desktop" in the ALT+TAB application switcher. I believe this to be a side effect of the Gnome interface having it set in the lower left hand corner, and when I switched back, I no longer had it. Seemed to work for me... worth a shot.

- 553
- 1
- 10
- 33
-
1Thanks for sharing your experience. How risky is this approach? I can't afford putting the stability of my work environment in jeopardy. – David Dossot Jul 27 '12 at 20:22
-
For me, I had no issues with this otherwise, however I'm also not 100% sure that was it. If you have VM it might be nice to test this theory, I also edited the panels a lot, removing and adding items such as workspace switchers and the trash icon to replace the real feel of gnome that 10.10 had. I wouldn't think too risky, but worth a try. If you're really that worried you could back up everything, but it shouldn't do anything out of the ordinary. I also might have just gotten a lucky bug. I don't know, I'll test this myself as well. See what I can do for you. – esnowrackley Jul 27 '12 at 21:51
One option could be to revert back to the behavior of Alt+Tab prior to 11.10.
I realize that this is a bit drastic, but it might be better than nothing.
Warning: I got this to work exactly once. When I restarted, I had two instances of unity running, and couldn't figure out why or how. killing them didn't work, and uninstalling reinstalling didn't help.
I resolved it by installing 13.10. I'll use the other fixes listed here.
I couldn't get this to work in 12.04, the package provided in another answer wasn't new enough (version 5.14), and the guide wasn't quite flawless. (though it was very helpful) Here's how I managed to apply the fix for unity 5.20
1) Download the source:
sudo apt-get source unity
2) Change the source:
diff -ru org/plugins/unityshell/src/LauncherController.cpp patch/plugins/unityshell/src/LauncherController.cpp
--- unity-5.20.0/plugins/unityshell/src/LauncherController.cpp 2013-04-12 04:24:42.000000000 -0400
+++ unity-diff/plugins/unityshell/src/LauncherController.cpp 2013-12-23 12:22:50.154961579 -0500
@@ -761,7 +761,7 @@
{
std::vector<AbstractLauncherIcon::Ptr> results;
- results.push_back(pimpl->desktop_icon_);
+ //results.push_back(pimpl->desktop_icon_);
for (auto icon : *(pimpl->model_))
{
diff -ru org/plugins/unityshell/src/unityshell.cpp patch/plugins/unityshell/src/unityshell.cpp
--- unity-5.20.0/plugins/unityshell/src/unityshell.cpp 2013-04-12 04:24:42.000000000 -0400
+++ unity-diff/plugins/unityshell/src/unityshell.cpp 2013-12-23 12:24:36.718966737 -0500
@@ -1909,7 +1909,8 @@
auto results = launcher_controller_->GetAltTabIcons(show_mode == switcher::ShowMode::CURRENT_VIEWPORT);
- if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::TYPE_DESKTOP))
+// if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::TYPE_DESKTOP))
+ if (!(results.size() == 0))
switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);
return true;
3) Install other packages:
sudo apt-get build-dep unity
sudo apt-get install cmake
5) Run cmake.
cd <source folder>
# from the INSTALL file
mkdir build; cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=package -DCMAKE_INSTALL_PREFIX=/opt/unity
make
sudo make install
Note: if you set your DCMAKE_INSTALL_PREFIX folder to /usr
instead of /opt/unity
, you won't have to rsync later, but I wanted to try linking the file first. I gave up.
I suppose to undo the best option is to reinstall unity, which would put the standard files overtop.
6) Replace the files:
sudo rsync -av /opt/unity/ /usr/
7) Reinstall unity-greeter. Apparently the files rsynced break unity-greeter. Which is apparently needed to get unity running.
sudo apt-get install --reinstall unity-greeter
If you're using dconf
to manage your Unity settings, then the path to this setting (by inspection with dconf watch /
) is:
/org/compiz/profiles/unity/plugins/unityshell/disable-show-desktop
Set this to true
and the desktop will be removed as an alt-tab
option.