{"id":8294,"date":"2018-10-26T17:37:06","date_gmt":"2018-10-26T17:37:06","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=8294"},"modified":"2023-09-24T13:44:48","modified_gmt":"2023-09-24T13:44:48","slug":"add-show-desktop-button-ubuntu-18-10-18-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2018\/10\/add-show-desktop-button-ubuntu-18-10-18-04\/","title":{"rendered":"Add &#8216;Show Desktop&#8217; to Dock Panel in Ubuntu 20.04 &#038; 18.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-34682\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature-250x250.png\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature-250x250.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature-300x300.png 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature-600x600.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature-768x768.png 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature.png 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This simply tutorial shows how to add a &#8216;<b>Show Desktop<\/b>&#8216; icon into the left dock panel in Ubuntu 21.10, Ubuntu 20.04, or Ubuntu 18.04 with default GNOME desktop.<\/p>\n<p>The &#8216;<b>Show Desktop<\/b>&#8216; button was dropped since Ubuntu switched to Gnome 3 Desktop. For those using desktop app shortcuts, it&#8217;s useful to have a button to toggle display blank desktop quickly. And to add it back, you can manually create shortcut icon to do the trick and add it to panel (dock).<\/p>\n<p>As you may know, the keyboard shortcuts <code>Ctrl+Alt+d<\/code> or <code>Super+d<\/code> do the function hide or show all opened app windows. And following steps will create a &#8216;show desktop&#8217; shortcut icon simulates the keyboard press (<code>Super+d<\/code>) via the <code>xdotool<\/code> tool.<\/p>\n<div class=\"arconix-box arconix-box-red\"><i class='fa fa-2x pull-left fa-exclamation-triangle'><\/i><div class=\"arconix-box-content\">NOTE that following steps don&#8217;t work on Wayland session, since xdotool simulates <b>X11<\/b> keyboard\/mouse input events.<\/div><\/div>\n<h3>1. Install xdotool:<\/h3>\n<p>Xdotool is a command-line X11 automation tool, that allows to simulate keyboard input and mouse activity, move and resize windows, etc.<\/p>\n<p>To install it, open terminal either by pressing Ctrl+Alt+T key combination on keyboard, or by searching from the activities overview screen. When terminal opens, paste the command below into it and hit run:<\/p>\n<pre style=\"border: none;\">sudo apt-get install xdotool<\/pre>\n<p><i>Type your user password (no asterisk feedback) when it prompts and answer y to confirm.<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/apt-xdotool.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-34718\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/apt-xdotool.png\" alt=\"\" width=\"600\" height=\"293\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/apt-xdotool.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/apt-xdotool-300x147.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>2. Create a shortcut icon for Show Desktop:<\/h3>\n<p>Most Linux distributions identify app shortcut icons via <b>.desktop<\/b> file under &#8220;\/usr\/share\/applications&#8221; for global or &#8216;.local\/share\/applications&#8217; for local user only.<\/p>\n<p>To create an app shortcut in the case, run command in terminal:<\/p>\n<pre style=\"border: none;\">gedit ~\/.local\/share\/applications\/show-desktop.desktop<\/pre>\n<p>This command will create and also open it via gedit text editor. When the file opens, copy and paste the lines below and save it.<\/p>\n<pre style=\"background: none;\">[Desktop Entry]\r\nType=Application\r\nName=Show Desktop\r\nIcon=desktop\r\nExec=xdotool key --clearmodifiers Super+d<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/create-showdesktop.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-34719\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/create-showdesktop.png\" alt=\"\" width=\"600\" height=\"272\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/create-showdesktop.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/create-showdesktop-300x136.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>3. Add show desktop to dock panel:<\/h3>\n<p>After created the shortcut, either press <i>Windows<\/i> (or <i>Super<\/i>) key on keyboard or click upper-left corner &#8216;Activities&#8217; to bring up the overview screen.<\/p>\n<p>Then search for &#8216;Show Desktop&#8217; (without quotes), right-click on the result icon and select &#8216;Add to Favorites&#8217;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/add-showdesktop-favorite.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-34720\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/add-showdesktop-favorite.png\" alt=\"\" width=\"600\" height=\"245\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/add-showdesktop-favorite.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/add-showdesktop-favorite-300x123.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Finally, you&#8217;ll see the &#8216;Show Desktop&#8217; icon on the dock panel. As mentioned, it works only on Xorg session. For Ubuntu 21.04 and higher, you may need to choose &#8216;<i>Ubuntu on Xorg<\/i>&#8216; from the login screen via the gear button.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/ubuntu-xorg-session.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-34721\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/ubuntu-xorg-session-600x337.jpg\" alt=\"\" width=\"600\" height=\"337\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/ubuntu-xorg-session-600x337.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/ubuntu-xorg-session-300x169.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/ubuntu-xorg-session-768x432.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/10\/ubuntu-xorg-session.jpg 1366w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>That&#8217;s all. Enjoy!<\/p>","protected":false},"excerpt":{"rendered":"<p>This simply tutorial shows how to add a &#8216;Show Desktop&#8216; icon into the left dock panel in Ubuntu 21.10, Ubuntu 20.04, or Ubuntu 18.04 with default GNOME desktop. The &#8216;Show Desktop&#8216; button was dropped since Ubuntu switched to Gnome 3 Desktop. For those using desktop app shortcuts, it&#8217;s useful to have a button to toggle [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":34682,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[647,1527],"class_list":["post-8294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-show-desktop","tag-ubuntu-18-04"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/8294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=8294"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/8294\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/34682"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=8294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=8294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=8294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}