Ubuntu – How to remove “Show Desktop” from the Alt-Tab (application) switcher

application-switcherunity

Is it possible to remove "Show Desktop" from the Alt+Tab application switcher?

Best Answer

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:

    enter image description here

  • 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:

  1. 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_);
  1. 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).
Related Question