New install of Ubuntu desktop 22.04. I'm trying to get Show Desktop script working for use by all users, with icon in Left Panel of apps. I've put both a shell script show-desktop.sh permissions of 644) using wmctrl and a desktop file show-desktop.desktop with permissions of 744 in /usr/share/applications. However, I don't get Show Desktop found in Activities or Apps. Here is show-desktop.desktop:

[Desktop Entry]

Type=Application Name=Show Desktop Exec=/usr/share/applications/show-desktop.sh Icon=desktop

Here is show-desktop.sh:


status="$(wmctrl -m | grep "showing the desktop" | sed -r 's/(.*)(ON|OFF)/\2/g')"

if [ $status == "ON" ]; then wmctrl -k off else wmctrl -k on fi

What am I doing wrong?

2 Answers 2


.desktop launchers are only included in the overview if the minimum of required fields is valid. In this case, the exec= entry is not valid: the permission of the script are set to "read only" for others. Therefore, the script is not recognized as a valid executable for users that are not the owner. Thus, make the script executable by "others".

  • I changed permissions of desktop file in /usr/share/applications to 777, but app still not found in Activities or Apps.
    – John Rose
    Jun 19 at 14:09
  • I copied your files exactly, and "Show Desktop" for me appears in the application overview, with a generic icon though because I do not have a "desktop" icon.
    – vanadium
    Jun 20 at 9:15

Now working. Here is my ShowDesktop.desktop file (with permissions 644) in /usr/share/applications/: [Desktop Entry] Version=1.0 Type=Application Terminal=false Exec=/usr/bin/ShowDesktop.sh Name=Show Desktop Comment=Show Desktop Icon=/usr/share/pixmaps/ShowDesktop.jpeg

Here is my ShowDesktop.sh file (with permissions 755) in /usr/bin/: #!/bin/bash

status="$(wmctrl -m | grep "showing the desktop" | sed -r 's/(.*)(ON|OFF)/\2/g')"

if [ $status == "ON" ]; then wmctrl -k off else wmctrl -k on fi

My icon ShowDesktop.jpeg (with permissions 644) is in /usr/share/pixmaps/

The directories I used for the Exec and the Icon lines in the ShowDesktop.desktop file (/usr/bin/, /usr/share/pixmaps) were culled from previous AskUbuntu answers: Standard place for custom scripts Icon Path in Desktop File

  • Correction to my answer: /usr/bin should be /usr/local/bin in my answer.
    – John Rose
    Jun 23 at 9:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .