Add “Show Desktop” shortcut to plank












0















I am using Plank on Ubuntu 14.04, I want to add "show desktop" shortcut to plank so that whenever I click it I get to see the desktop directly instead of minimizing all the windows. How can I do it?










share|improve this question





























    0















    I am using Plank on Ubuntu 14.04, I want to add "show desktop" shortcut to plank so that whenever I click it I get to see the desktop directly instead of minimizing all the windows. How can I do it?










    share|improve this question



























      0












      0








      0








      I am using Plank on Ubuntu 14.04, I want to add "show desktop" shortcut to plank so that whenever I click it I get to see the desktop directly instead of minimizing all the windows. How can I do it?










      share|improve this question
















      I am using Plank on Ubuntu 14.04, I want to add "show desktop" shortcut to plank so that whenever I click it I get to see the desktop directly instead of minimizing all the windows. How can I do it?







      plank






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 26 '15 at 6:01







      Edward Torvalds

















      asked Mar 30 '15 at 13:14









      Edward TorvaldsEdward Torvalds

      5,13274079




      5,13274079






















          1 Answer
          1






          active

          oldest

          votes


















          0
















          1. First of all install the xdotool:




            sudo apt-get install xdotool





          2. Create a Desktop Shortcut for the 'Show Desktop' for simulate the press key WIN+D using xdotool:




            sudo nano /usr/share/applications/show-desktop.desktop




            The contents:




            [Desktop Entry]

            Type=Application

            Exec=xdotool key --delay 100 super+d

            Name=Show Desktop

            Icon=desktop

            Terminal=false

            StartupNotify=false




            Or skip the boring edit part from above and enter this:




            echo -e "[Desktop Entry]nType=ApplicationnExec=xdotool key --delay 100 super+dnName=Show DesktopnIcon=desktopnTerminal=falsenStartupNotify=false" | sudo tee /usr/share/applications/show-desktop.desktop > /dev/null





          3. Create a Dockitem file in Phank:




            nano ~/.config/plank/dock1/launchers/show-desktop.dockitem




            The contents:




            [PlankItemsDockItemPreferences]

            Launcher=file:///usr/share/applications/show-desktop.desktop




            Or skip the boring edit part from above and enter this:




            /bin/bash -c 'echo -e "[PlankItemsDockItemPreferences]nLauncher=file:///usr/share/applications/show-desktop.desktop" | tee ~/.config/plank/dock1/launchers/show-desktop.dockitem'





          4. Make It Permanent



            Now create a entry for the command above in gnome-session-properties. Because if accidentally make a mistake and remove the "Show Desktop" dockitem (uncheck 'Keep In Dock'), so you need to re-create the dockitem file again every time. To solve this problem, we just force to recreate the dockitem file on every session startup:




            echo -e "[Desktop Entry]nType=ApplicationnExec=/bin/bash -c 'echo -e "[PlankItemsDockItemPreferences]\nLauncher=file:///usr/share/applications/show-desktop.desktop" | tee ~/.config/plank/dock1/launchers/show-desktop.dockitem'nHidden=falsenX-GNOME-Autostart-enabled=truenName=show-desktop-in-phank" | tee ~/.config/autostart/show-desktop-in-phank.desktop > /dev/null









          share|improve this answer


























          • there are some spelling mistakes and errors in your code please review it, also I did all still its not working :-/

            – Edward Torvalds
            Apr 26 '15 at 6:28











          • @edwardtorvalds, try this , I remake the whole procedure. Sorry my bad english, your help in this matter will be very appreciated!

            – Maxwel Leite
            Apr 27 '15 at 23:57











          • Hello, it doesn't behave correctly when I click on it. It either takes me to the unity dash or it hides all the windows. And when it hides all the windows, it doesn't let me unhide all the windows again. It is a bit bizarre.

            – vikramreddym
            Jun 8 '17 at 0:08











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f603120%2fadd-show-desktop-shortcut-to-plank%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0
















          1. First of all install the xdotool:




            sudo apt-get install xdotool





          2. Create a Desktop Shortcut for the 'Show Desktop' for simulate the press key WIN+D using xdotool:




            sudo nano /usr/share/applications/show-desktop.desktop




            The contents:




            [Desktop Entry]

            Type=Application

            Exec=xdotool key --delay 100 super+d

            Name=Show Desktop

            Icon=desktop

            Terminal=false

            StartupNotify=false




            Or skip the boring edit part from above and enter this:




            echo -e "[Desktop Entry]nType=ApplicationnExec=xdotool key --delay 100 super+dnName=Show DesktopnIcon=desktopnTerminal=falsenStartupNotify=false" | sudo tee /usr/share/applications/show-desktop.desktop > /dev/null





          3. Create a Dockitem file in Phank:




            nano ~/.config/plank/dock1/launchers/show-desktop.dockitem




            The contents:




            [PlankItemsDockItemPreferences]

            Launcher=file:///usr/share/applications/show-desktop.desktop




            Or skip the boring edit part from above and enter this:




            /bin/bash -c 'echo -e "[PlankItemsDockItemPreferences]nLauncher=file:///usr/share/applications/show-desktop.desktop" | tee ~/.config/plank/dock1/launchers/show-desktop.dockitem'





          4. Make It Permanent



            Now create a entry for the command above in gnome-session-properties. Because if accidentally make a mistake and remove the "Show Desktop" dockitem (uncheck 'Keep In Dock'), so you need to re-create the dockitem file again every time. To solve this problem, we just force to recreate the dockitem file on every session startup:




            echo -e "[Desktop Entry]nType=ApplicationnExec=/bin/bash -c 'echo -e "[PlankItemsDockItemPreferences]\nLauncher=file:///usr/share/applications/show-desktop.desktop" | tee ~/.config/plank/dock1/launchers/show-desktop.dockitem'nHidden=falsenX-GNOME-Autostart-enabled=truenName=show-desktop-in-phank" | tee ~/.config/autostart/show-desktop-in-phank.desktop > /dev/null









          share|improve this answer


























          • there are some spelling mistakes and errors in your code please review it, also I did all still its not working :-/

            – Edward Torvalds
            Apr 26 '15 at 6:28











          • @edwardtorvalds, try this , I remake the whole procedure. Sorry my bad english, your help in this matter will be very appreciated!

            – Maxwel Leite
            Apr 27 '15 at 23:57











          • Hello, it doesn't behave correctly when I click on it. It either takes me to the unity dash or it hides all the windows. And when it hides all the windows, it doesn't let me unhide all the windows again. It is a bit bizarre.

            – vikramreddym
            Jun 8 '17 at 0:08
















          0
















          1. First of all install the xdotool:




            sudo apt-get install xdotool





          2. Create a Desktop Shortcut for the 'Show Desktop' for simulate the press key WIN+D using xdotool:




            sudo nano /usr/share/applications/show-desktop.desktop




            The contents:




            [Desktop Entry]

            Type=Application

            Exec=xdotool key --delay 100 super+d

            Name=Show Desktop

            Icon=desktop

            Terminal=false

            StartupNotify=false




            Or skip the boring edit part from above and enter this:




            echo -e "[Desktop Entry]nType=ApplicationnExec=xdotool key --delay 100 super+dnName=Show DesktopnIcon=desktopnTerminal=falsenStartupNotify=false" | sudo tee /usr/share/applications/show-desktop.desktop > /dev/null





          3. Create a Dockitem file in Phank:




            nano ~/.config/plank/dock1/launchers/show-desktop.dockitem




            The contents:




            [PlankItemsDockItemPreferences]

            Launcher=file:///usr/share/applications/show-desktop.desktop




            Or skip the boring edit part from above and enter this:




            /bin/bash -c 'echo -e "[PlankItemsDockItemPreferences]nLauncher=file:///usr/share/applications/show-desktop.desktop" | tee ~/.config/plank/dock1/launchers/show-desktop.dockitem'





          4. Make It Permanent



            Now create a entry for the command above in gnome-session-properties. Because if accidentally make a mistake and remove the "Show Desktop" dockitem (uncheck 'Keep In Dock'), so you need to re-create the dockitem file again every time. To solve this problem, we just force to recreate the dockitem file on every session startup:




            echo -e "[Desktop Entry]nType=ApplicationnExec=/bin/bash -c 'echo -e "[PlankItemsDockItemPreferences]\nLauncher=file:///usr/share/applications/show-desktop.desktop" | tee ~/.config/plank/dock1/launchers/show-desktop.dockitem'nHidden=falsenX-GNOME-Autostart-enabled=truenName=show-desktop-in-phank" | tee ~/.config/autostart/show-desktop-in-phank.desktop > /dev/null









          share|improve this answer


























          • there are some spelling mistakes and errors in your code please review it, also I did all still its not working :-/

            – Edward Torvalds
            Apr 26 '15 at 6:28











          • @edwardtorvalds, try this , I remake the whole procedure. Sorry my bad english, your help in this matter will be very appreciated!

            – Maxwel Leite
            Apr 27 '15 at 23:57











          • Hello, it doesn't behave correctly when I click on it. It either takes me to the unity dash or it hides all the windows. And when it hides all the windows, it doesn't let me unhide all the windows again. It is a bit bizarre.

            – vikramreddym
            Jun 8 '17 at 0:08














          0












          0








          0









          1. First of all install the xdotool:




            sudo apt-get install xdotool





          2. Create a Desktop Shortcut for the 'Show Desktop' for simulate the press key WIN+D using xdotool:




            sudo nano /usr/share/applications/show-desktop.desktop




            The contents:




            [Desktop Entry]

            Type=Application

            Exec=xdotool key --delay 100 super+d

            Name=Show Desktop

            Icon=desktop

            Terminal=false

            StartupNotify=false




            Or skip the boring edit part from above and enter this:




            echo -e "[Desktop Entry]nType=ApplicationnExec=xdotool key --delay 100 super+dnName=Show DesktopnIcon=desktopnTerminal=falsenStartupNotify=false" | sudo tee /usr/share/applications/show-desktop.desktop > /dev/null





          3. Create a Dockitem file in Phank:




            nano ~/.config/plank/dock1/launchers/show-desktop.dockitem




            The contents:




            [PlankItemsDockItemPreferences]

            Launcher=file:///usr/share/applications/show-desktop.desktop




            Or skip the boring edit part from above and enter this:




            /bin/bash -c 'echo -e "[PlankItemsDockItemPreferences]nLauncher=file:///usr/share/applications/show-desktop.desktop" | tee ~/.config/plank/dock1/launchers/show-desktop.dockitem'





          4. Make It Permanent



            Now create a entry for the command above in gnome-session-properties. Because if accidentally make a mistake and remove the "Show Desktop" dockitem (uncheck 'Keep In Dock'), so you need to re-create the dockitem file again every time. To solve this problem, we just force to recreate the dockitem file on every session startup:




            echo -e "[Desktop Entry]nType=ApplicationnExec=/bin/bash -c 'echo -e "[PlankItemsDockItemPreferences]\nLauncher=file:///usr/share/applications/show-desktop.desktop" | tee ~/.config/plank/dock1/launchers/show-desktop.dockitem'nHidden=falsenX-GNOME-Autostart-enabled=truenName=show-desktop-in-phank" | tee ~/.config/autostart/show-desktop-in-phank.desktop > /dev/null









          share|improve this answer

















          1. First of all install the xdotool:




            sudo apt-get install xdotool





          2. Create a Desktop Shortcut for the 'Show Desktop' for simulate the press key WIN+D using xdotool:




            sudo nano /usr/share/applications/show-desktop.desktop




            The contents:




            [Desktop Entry]

            Type=Application

            Exec=xdotool key --delay 100 super+d

            Name=Show Desktop

            Icon=desktop

            Terminal=false

            StartupNotify=false




            Or skip the boring edit part from above and enter this:




            echo -e "[Desktop Entry]nType=ApplicationnExec=xdotool key --delay 100 super+dnName=Show DesktopnIcon=desktopnTerminal=falsenStartupNotify=false" | sudo tee /usr/share/applications/show-desktop.desktop > /dev/null





          3. Create a Dockitem file in Phank:




            nano ~/.config/plank/dock1/launchers/show-desktop.dockitem




            The contents:




            [PlankItemsDockItemPreferences]

            Launcher=file:///usr/share/applications/show-desktop.desktop




            Or skip the boring edit part from above and enter this:




            /bin/bash -c 'echo -e "[PlankItemsDockItemPreferences]nLauncher=file:///usr/share/applications/show-desktop.desktop" | tee ~/.config/plank/dock1/launchers/show-desktop.dockitem'





          4. Make It Permanent



            Now create a entry for the command above in gnome-session-properties. Because if accidentally make a mistake and remove the "Show Desktop" dockitem (uncheck 'Keep In Dock'), so you need to re-create the dockitem file again every time. To solve this problem, we just force to recreate the dockitem file on every session startup:




            echo -e "[Desktop Entry]nType=ApplicationnExec=/bin/bash -c 'echo -e "[PlankItemsDockItemPreferences]\nLauncher=file:///usr/share/applications/show-desktop.desktop" | tee ~/.config/plank/dock1/launchers/show-desktop.dockitem'nHidden=falsenX-GNOME-Autostart-enabled=truenName=show-desktop-in-phank" | tee ~/.config/autostart/show-desktop-in-phank.desktop > /dev/null










          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 28 '15 at 18:24

























          answered Apr 26 '15 at 4:22









          Maxwel LeiteMaxwel Leite

          1,56411225




          1,56411225













          • there are some spelling mistakes and errors in your code please review it, also I did all still its not working :-/

            – Edward Torvalds
            Apr 26 '15 at 6:28











          • @edwardtorvalds, try this , I remake the whole procedure. Sorry my bad english, your help in this matter will be very appreciated!

            – Maxwel Leite
            Apr 27 '15 at 23:57











          • Hello, it doesn't behave correctly when I click on it. It either takes me to the unity dash or it hides all the windows. And when it hides all the windows, it doesn't let me unhide all the windows again. It is a bit bizarre.

            – vikramreddym
            Jun 8 '17 at 0:08



















          • there are some spelling mistakes and errors in your code please review it, also I did all still its not working :-/

            – Edward Torvalds
            Apr 26 '15 at 6:28











          • @edwardtorvalds, try this , I remake the whole procedure. Sorry my bad english, your help in this matter will be very appreciated!

            – Maxwel Leite
            Apr 27 '15 at 23:57











          • Hello, it doesn't behave correctly when I click on it. It either takes me to the unity dash or it hides all the windows. And when it hides all the windows, it doesn't let me unhide all the windows again. It is a bit bizarre.

            – vikramreddym
            Jun 8 '17 at 0:08

















          there are some spelling mistakes and errors in your code please review it, also I did all still its not working :-/

          – Edward Torvalds
          Apr 26 '15 at 6:28





          there are some spelling mistakes and errors in your code please review it, also I did all still its not working :-/

          – Edward Torvalds
          Apr 26 '15 at 6:28













          @edwardtorvalds, try this , I remake the whole procedure. Sorry my bad english, your help in this matter will be very appreciated!

          – Maxwel Leite
          Apr 27 '15 at 23:57





          @edwardtorvalds, try this , I remake the whole procedure. Sorry my bad english, your help in this matter will be very appreciated!

          – Maxwel Leite
          Apr 27 '15 at 23:57













          Hello, it doesn't behave correctly when I click on it. It either takes me to the unity dash or it hides all the windows. And when it hides all the windows, it doesn't let me unhide all the windows again. It is a bit bizarre.

          – vikramreddym
          Jun 8 '17 at 0:08





          Hello, it doesn't behave correctly when I click on it. It either takes me to the unity dash or it hides all the windows. And when it hides all the windows, it doesn't let me unhide all the windows again. It is a bit bizarre.

          – vikramreddym
          Jun 8 '17 at 0:08


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f603120%2fadd-show-desktop-shortcut-to-plank%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to make a Squid Proxy server?

          Is this a new Fibonacci Identity?

          19世紀