How can I add “Show desktop” to the GNOME dash or Ubuntu Dock?











up vote
23
down vote

favorite
6












I am migrating from Unity to GNOME. One item I am missing is a "Show desktop" button (aka "minimise all windows") in the dash. How can I add this functionality to the GNOME dash (or Ubuntu dock in Ubuntu 17.10 and later), even if it means making a custom .desktop file?



(I know that I can use the Ctrl + Super + D keyboard shortcut to show the desktop and that I can install an extension to add a "Show desktop" button to the top bar, but I specifically want a button in the dash.)










share|improve this question




























    up vote
    23
    down vote

    favorite
    6












    I am migrating from Unity to GNOME. One item I am missing is a "Show desktop" button (aka "minimise all windows") in the dash. How can I add this functionality to the GNOME dash (or Ubuntu dock in Ubuntu 17.10 and later), even if it means making a custom .desktop file?



    (I know that I can use the Ctrl + Super + D keyboard shortcut to show the desktop and that I can install an extension to add a "Show desktop" button to the top bar, but I specifically want a button in the dash.)










    share|improve this question


























      up vote
      23
      down vote

      favorite
      6









      up vote
      23
      down vote

      favorite
      6






      6





      I am migrating from Unity to GNOME. One item I am missing is a "Show desktop" button (aka "minimise all windows") in the dash. How can I add this functionality to the GNOME dash (or Ubuntu dock in Ubuntu 17.10 and later), even if it means making a custom .desktop file?



      (I know that I can use the Ctrl + Super + D keyboard shortcut to show the desktop and that I can install an extension to add a "Show desktop" button to the top bar, but I specifically want a button in the dash.)










      share|improve this question















      I am migrating from Unity to GNOME. One item I am missing is a "Show desktop" button (aka "minimise all windows") in the dash. How can I add this functionality to the GNOME dash (or Ubuntu dock in Ubuntu 17.10 and later), even if it means making a custom .desktop file?



      (I know that I can use the Ctrl + Super + D keyboard shortcut to show the desktop and that I can install an extension to add a "Show desktop" button to the top bar, but I specifically want a button in the dash.)







      gnome gnome-shell gnome-shell-extension ubuntu-dock show-desktop






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 9 at 15:25









      pomsky

      27.4k1184111




      27.4k1184111










      asked Apr 11 '17 at 12:12









      d3vid

      7,3591970137




      7,3591970137






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          28
          down vote



          +100










          I found a way to do that:





          1. Open a terminal and install wmctrl:



            sudo apt-get install wmctrl



          2. Create a shell script named show-desktop.sh (I put it in my home folder)



            gedit ~/show-desktop.sh


            place this code in there:



            #!/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


            and make it executable:



            chmod +x ~/show-desktop.sh



          3. Create a file show-desktop.desktop in ~/.local/share/applications/ folder:



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


            Add this text and save (don't forget change the value on <your user>):



            [Desktop Entry]
            Type=Application
            Name=Show Desktop
            Icon=user-desktop
            Exec=/home/<your user>/show-desktop.sh


          4. Open the dash, search for show desktop and add it to the favorites.







          share|improve this answer



















          • 6




            Tested and working also on Ubuntu 18.04 LTS. This is the best way I've found to do it since they removed the 'Add show desktop icon to the launcher' option from System Settings / Appearance / Behaviour panel. It was such an useful feature. Sometimes I really do not understand Ubuntu developers...
            – bytepan
            Apr 29 at 9:30






          • 4




            In the file "show-desktop.desktop" (topic 3), I changed "Icon=show-desktop" to "Icon=desktop",because the previous one was not working.
            – samuelcersosimo
            May 20 at 3:56










          • This is not beginner friendly. How do I create a file in the applications folder? I can't just create it and save it there through the gui because it's protected. Thanks.
            – Rabbit
            Sep 1 at 12:06








          • 2




            @Rabbit you need to use root privileges. Open a terminal and type: sudo nano /use/share/applications/show-desktop.desktop
            – AndAC
            Sep 1 at 12:10






          • 1




            @Rabbit I understand. I do think this could be better explained. Maybe someone with a better English could edit my post to make it easier for beginners.
            – AndAC
            Sep 1 at 12:41










          protected by Community Jul 30 at 14:40



          Thank you for your interest in this question.
          Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



          Would you like to answer one of these unanswered questions instead?














          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          28
          down vote



          +100










          I found a way to do that:





          1. Open a terminal and install wmctrl:



            sudo apt-get install wmctrl



          2. Create a shell script named show-desktop.sh (I put it in my home folder)



            gedit ~/show-desktop.sh


            place this code in there:



            #!/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


            and make it executable:



            chmod +x ~/show-desktop.sh



          3. Create a file show-desktop.desktop in ~/.local/share/applications/ folder:



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


            Add this text and save (don't forget change the value on <your user>):



            [Desktop Entry]
            Type=Application
            Name=Show Desktop
            Icon=user-desktop
            Exec=/home/<your user>/show-desktop.sh


          4. Open the dash, search for show desktop and add it to the favorites.







          share|improve this answer



















          • 6




            Tested and working also on Ubuntu 18.04 LTS. This is the best way I've found to do it since they removed the 'Add show desktop icon to the launcher' option from System Settings / Appearance / Behaviour panel. It was such an useful feature. Sometimes I really do not understand Ubuntu developers...
            – bytepan
            Apr 29 at 9:30






          • 4




            In the file "show-desktop.desktop" (topic 3), I changed "Icon=show-desktop" to "Icon=desktop",because the previous one was not working.
            – samuelcersosimo
            May 20 at 3:56










          • This is not beginner friendly. How do I create a file in the applications folder? I can't just create it and save it there through the gui because it's protected. Thanks.
            – Rabbit
            Sep 1 at 12:06








          • 2




            @Rabbit you need to use root privileges. Open a terminal and type: sudo nano /use/share/applications/show-desktop.desktop
            – AndAC
            Sep 1 at 12:10






          • 1




            @Rabbit I understand. I do think this could be better explained. Maybe someone with a better English could edit my post to make it easier for beginners.
            – AndAC
            Sep 1 at 12:41















          up vote
          28
          down vote



          +100










          I found a way to do that:





          1. Open a terminal and install wmctrl:



            sudo apt-get install wmctrl



          2. Create a shell script named show-desktop.sh (I put it in my home folder)



            gedit ~/show-desktop.sh


            place this code in there:



            #!/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


            and make it executable:



            chmod +x ~/show-desktop.sh



          3. Create a file show-desktop.desktop in ~/.local/share/applications/ folder:



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


            Add this text and save (don't forget change the value on <your user>):



            [Desktop Entry]
            Type=Application
            Name=Show Desktop
            Icon=user-desktop
            Exec=/home/<your user>/show-desktop.sh


          4. Open the dash, search for show desktop and add it to the favorites.







          share|improve this answer



















          • 6




            Tested and working also on Ubuntu 18.04 LTS. This is the best way I've found to do it since they removed the 'Add show desktop icon to the launcher' option from System Settings / Appearance / Behaviour panel. It was such an useful feature. Sometimes I really do not understand Ubuntu developers...
            – bytepan
            Apr 29 at 9:30






          • 4




            In the file "show-desktop.desktop" (topic 3), I changed "Icon=show-desktop" to "Icon=desktop",because the previous one was not working.
            – samuelcersosimo
            May 20 at 3:56










          • This is not beginner friendly. How do I create a file in the applications folder? I can't just create it and save it there through the gui because it's protected. Thanks.
            – Rabbit
            Sep 1 at 12:06








          • 2




            @Rabbit you need to use root privileges. Open a terminal and type: sudo nano /use/share/applications/show-desktop.desktop
            – AndAC
            Sep 1 at 12:10






          • 1




            @Rabbit I understand. I do think this could be better explained. Maybe someone with a better English could edit my post to make it easier for beginners.
            – AndAC
            Sep 1 at 12:41













          up vote
          28
          down vote



          +100







          up vote
          28
          down vote



          +100




          +100




          I found a way to do that:





          1. Open a terminal and install wmctrl:



            sudo apt-get install wmctrl



          2. Create a shell script named show-desktop.sh (I put it in my home folder)



            gedit ~/show-desktop.sh


            place this code in there:



            #!/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


            and make it executable:



            chmod +x ~/show-desktop.sh



          3. Create a file show-desktop.desktop in ~/.local/share/applications/ folder:



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


            Add this text and save (don't forget change the value on <your user>):



            [Desktop Entry]
            Type=Application
            Name=Show Desktop
            Icon=user-desktop
            Exec=/home/<your user>/show-desktop.sh


          4. Open the dash, search for show desktop and add it to the favorites.







          share|improve this answer














          I found a way to do that:





          1. Open a terminal and install wmctrl:



            sudo apt-get install wmctrl



          2. Create a shell script named show-desktop.sh (I put it in my home folder)



            gedit ~/show-desktop.sh


            place this code in there:



            #!/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


            and make it executable:



            chmod +x ~/show-desktop.sh



          3. Create a file show-desktop.desktop in ~/.local/share/applications/ folder:



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


            Add this text and save (don't forget change the value on <your user>):



            [Desktop Entry]
            Type=Application
            Name=Show Desktop
            Icon=user-desktop
            Exec=/home/<your user>/show-desktop.sh


          4. Open the dash, search for show desktop and add it to the favorites.








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 20 at 20:10

























          answered Apr 16 '17 at 15:02









          AndAC

          63147




          63147








          • 6




            Tested and working also on Ubuntu 18.04 LTS. This is the best way I've found to do it since they removed the 'Add show desktop icon to the launcher' option from System Settings / Appearance / Behaviour panel. It was such an useful feature. Sometimes I really do not understand Ubuntu developers...
            – bytepan
            Apr 29 at 9:30






          • 4




            In the file "show-desktop.desktop" (topic 3), I changed "Icon=show-desktop" to "Icon=desktop",because the previous one was not working.
            – samuelcersosimo
            May 20 at 3:56










          • This is not beginner friendly. How do I create a file in the applications folder? I can't just create it and save it there through the gui because it's protected. Thanks.
            – Rabbit
            Sep 1 at 12:06








          • 2




            @Rabbit you need to use root privileges. Open a terminal and type: sudo nano /use/share/applications/show-desktop.desktop
            – AndAC
            Sep 1 at 12:10






          • 1




            @Rabbit I understand. I do think this could be better explained. Maybe someone with a better English could edit my post to make it easier for beginners.
            – AndAC
            Sep 1 at 12:41














          • 6




            Tested and working also on Ubuntu 18.04 LTS. This is the best way I've found to do it since they removed the 'Add show desktop icon to the launcher' option from System Settings / Appearance / Behaviour panel. It was such an useful feature. Sometimes I really do not understand Ubuntu developers...
            – bytepan
            Apr 29 at 9:30






          • 4




            In the file "show-desktop.desktop" (topic 3), I changed "Icon=show-desktop" to "Icon=desktop",because the previous one was not working.
            – samuelcersosimo
            May 20 at 3:56










          • This is not beginner friendly. How do I create a file in the applications folder? I can't just create it and save it there through the gui because it's protected. Thanks.
            – Rabbit
            Sep 1 at 12:06








          • 2




            @Rabbit you need to use root privileges. Open a terminal and type: sudo nano /use/share/applications/show-desktop.desktop
            – AndAC
            Sep 1 at 12:10






          • 1




            @Rabbit I understand. I do think this could be better explained. Maybe someone with a better English could edit my post to make it easier for beginners.
            – AndAC
            Sep 1 at 12:41








          6




          6




          Tested and working also on Ubuntu 18.04 LTS. This is the best way I've found to do it since they removed the 'Add show desktop icon to the launcher' option from System Settings / Appearance / Behaviour panel. It was such an useful feature. Sometimes I really do not understand Ubuntu developers...
          – bytepan
          Apr 29 at 9:30




          Tested and working also on Ubuntu 18.04 LTS. This is the best way I've found to do it since they removed the 'Add show desktop icon to the launcher' option from System Settings / Appearance / Behaviour panel. It was such an useful feature. Sometimes I really do not understand Ubuntu developers...
          – bytepan
          Apr 29 at 9:30




          4




          4




          In the file "show-desktop.desktop" (topic 3), I changed "Icon=show-desktop" to "Icon=desktop",because the previous one was not working.
          – samuelcersosimo
          May 20 at 3:56




          In the file "show-desktop.desktop" (topic 3), I changed "Icon=show-desktop" to "Icon=desktop",because the previous one was not working.
          – samuelcersosimo
          May 20 at 3:56












          This is not beginner friendly. How do I create a file in the applications folder? I can't just create it and save it there through the gui because it's protected. Thanks.
          – Rabbit
          Sep 1 at 12:06






          This is not beginner friendly. How do I create a file in the applications folder? I can't just create it and save it there through the gui because it's protected. Thanks.
          – Rabbit
          Sep 1 at 12:06






          2




          2




          @Rabbit you need to use root privileges. Open a terminal and type: sudo nano /use/share/applications/show-desktop.desktop
          – AndAC
          Sep 1 at 12:10




          @Rabbit you need to use root privileges. Open a terminal and type: sudo nano /use/share/applications/show-desktop.desktop
          – AndAC
          Sep 1 at 12:10




          1




          1




          @Rabbit I understand. I do think this could be better explained. Maybe someone with a better English could edit my post to make it easier for beginners.
          – AndAC
          Sep 1 at 12:41




          @Rabbit I understand. I do think this could be better explained. Maybe someone with a better English could edit my post to make it easier for beginners.
          – AndAC
          Sep 1 at 12:41





          protected by Community Jul 30 at 14:40



          Thank you for your interest in this question.
          Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



          Would you like to answer one of these unanswered questions instead?



          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Can I use Tabulator js library in my java Spring + Thymeleaf project?