Add ‘Show Desktop’ button in Ubuntu 18.10, 18.04

Add ‘Show Desktop’ button in Ubuntu 18.10, 18.04

This quick tutorial is going to show you how to add a ‘Show Desktop‘ icon into left dock launcher in Ubuntu 18.10 or Ubuntu 18.04.

The ‘Show Desktop‘ button was dropped since Ubuntu switched to Gnome 3 Desktop. To add it back, you can manually create show desktop shortcut icon and add it to panel (dock).

As you may know, the keyboard shortcuts Ctrl+Alt+d or Super+d do the function hide or show all opened app windows. And following steps will create a ‘show desktop’ shortcut icon simulates the keyboard press (Super+d) via xdotool.

NOTE that following steps don’t work on Wayland session, since xdotool simulates X11 keyboard/mouse input events.

1. Open terminal (Ctrl+Alt+T) and install xdotool:

sudo apt-get install xdotool

Type your user password (no asterisks feedback) when it prompts and hit Enter to continue.

Add ‘Show Desktop’ button in Ubuntu 18.10, 18.04

2. Then create the show desktop shortcut icon and edit it via command:

gedit ~/.local/share/applications/show-desktop.desktop

When the file opens, paste following lines and save it.

[Desktop Entry]
Type=Application
Name=Show Desktop
Icon=desktop
Exec=xdotool key --clearmodifiers Super+d

Add ‘Show Desktop’ button in Ubuntu 18.10, 18.04

3. Finally search for ‘show desktop’ in application menu, then right lick and select ‘add to favorites’:

Add ‘Show Desktop’ button in Ubuntu 18.10, 18.04

That’s it. Enjoy!

Original Article