Is it possible to remove "Show Desktop" from the Alt+Tab application switcher?
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.


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.cppfrom: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).
- 141,990
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,732
- 91
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.
- 563
- 1
- 10
- 33
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.
