16

Right now I have to minimize all windows one by one to get to the desktop. Is there a way to directly view the desktop?

14

I personally like to use Hot corners to show the desktop.

To do this, first install devilspie with:

sudo apt-get install devilspie

Then create a script file with:

io.elementary.code ~/minimize.ds

(or some other text editor) and inside that file paste the following content:

(if
    (begin
        (not(is(application_name) "wingpanel")))
(if
    (begin
        (not(is(application_name) "plank")))
(begin
    (minimize)
    (quit))
))

save and exit the text editor.

Then open Preferences/Desktop/Hot corners, select Personalized order for one of the corners and in the Execute custom command text box paste the following:

devilspie /home/<user>/minimize.ds

Replace <user> with your user name, so it looks like this (I've selected the bottom right corner):

enter image description here

After that, moving the mouse to that corner should show you the desktop.

  • 2
    Gabriel, this one works like a charm, and the best parts no need to logout and re-login, just setup and instanly activated :) – Ferri Sutanto Jul 13 '15 at 15:29
  • (No one downvoted the answer so far) Which command? This one devilspie /home/<user>/minimize.ds? It simple executes the script minimize.ds. – Gabriel Jul 13 '15 at 16:51
  • @Tim, sorry i choose this answer, because this is command too, see thats executed custom command from hot corner :) Anyway, thanks a lot for all respons Cheers – Ferri Sutanto Jul 13 '15 at 17:49
  • @Tim not sure if there's anything inherently better with my answer, I haven't tried yours. Both require installing an extra package, although yours is apparently capable of restoring the windows back to their previous positions whereas mine is not. I'll give your answer a try. – Gabriel Jul 13 '15 at 17:53
  • This method does not work as expected, it also hides the plank and wingpanel. – Vlad Pop Oct 11 at 8:15
10

SuperKey + Right/Left might be the easiest if your more of the casual user and are not fully using all the workspaces all the time. This will let you view the desktop.

  • This is probably going to be the simplest answer, to be honest. Just moving to a clean workspace makes the most sense. – Daniel Foré Jul 13 '15 at 17:40
  • 1
    I disagree. Minimizing all windows is a completely different task than changing to a different workspace. – Gabriel Jul 13 '15 at 17:54
  • @Gabriel Well, he is asking to view the desktop not minimize every window. – Kultom Jul 13 '15 at 18:05
  • 2
    @Kultom the original question did: elementaryos.stackexchange.com/revisions/396/1. I see now that it has been edited by Tim and changed its meaning. Not the first time he does this. – Gabriel Jul 13 '15 at 18:08
  • @Gabriel Ahh, right. – Kultom Jul 13 '15 at 18:11
7

You can put the 'Desktop' docket to Plank (the dock application).

Ctrl+Left-click on the dock and select Preferences from the menu. In the Docklets tab you can find Desktop, just drag-and-drop it to the dock application.

enter image description here

5

First, install wmctrl:

sudo apt-get install wmctrl

The command to show the desktop is the following:

wmctrl -k on

And to hide desktop (restore all windows) use

wmctrl -k off

You can add them to a keyboard shortcut, or a hot corner - like @Gabriel suggested.

  • Whats mistake Tim? – Ferri Sutanto Jul 13 '15 at 15:28
  • 1
    Its usually best (and the polite thing to do, in my personal view) to always leave a comment after you downvote a question/answer. Otherwise the user who wrote that question/answer is left wondering what they did wrong, like Tim right now, and nothing can be improved. – Gabriel Jul 13 '15 at 15:33
  • I'm not down voted your answer :) cheers – Ferri Sutanto Jul 13 '15 at 17:48
  • @Tim What does "hide desktop" mean? Ie: this command: wmctrl -k off. What does it do? – Gabriel Jul 13 '15 at 17:55
  • @Gabriel it's hard to see the effect because if you unminimise the terminal, it doesn't work. Try this: wmctrl -k on ; sleep 3; wmctrl -k off. – user3 Jul 13 '15 at 17:57
1

I use devilspie like in Gabriel's answer, only I like to be able to restore my windows with the same script, so my devilspie script looks like:

(begin
  (if (matches (window_property "_NET_WM_STATE") "_NET_WM_STATE_HIDDEN")
  (begin
  (unminimize)
  (quit)
  )
  (begin 
  (minimize)
  (quit)
  )
  )
  (quit)
  )

Everything else is the same as Gabriel's answer.

The only problem is it does not keep my windows in the same order when it restores them.

0

I have done a bash script which uses Xwindow utilities such as xwininfo, xdotool and wmctrl. All details and full Code of the script at http://fpkanarias.blogspot.com.es/2017/12/elementary-os-script-para-mostrar.html

0

Install Windows Management control or wmctrl: sudo apt install wmctrl

now, typing the following command in the terminal will show the desktop: wmctrl -k on

That is OK, but it is easier with a keyboard shortcut.

  • Open System Settings->Keyboard (or search keyboard in Applications for Loki 0.4 Elementary OS and possibly other distributions)

  • Go to 'Shortcuts tab

  • Go to 'Custom'

  • Click the '+' and type wmctrl -k on and 'Enter'

  • The shortcut will show is 'Disabled' on the right

  • Click on 'Disabled' and click on the shortcut you like for example the 'Windows' button + D, also known as 'Super + D' enter image description here

  • Try it: click you shortcut. You should see the desktop

That is it. You are done.

Note: this answer is basically the same as Alex's here, I just added more detailed steps (and tried to +1 his, but not enough reputation :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.