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?
7 Answers
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):
After that, moving the mouse to that corner should show you the desktop.
-
2Gabriel, this one works like a charm, and the best parts no need to logout and re-login, just setup and instanly activated :) Jul 13, 2015 at 15:29
-
(No one downvoted the answer so far) Which command? This one
devilspie /home/<user>/minimize.ds
? It simple executes the scriptminimize.ds
.– GabrielJul 13, 2015 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 Jul 13, 2015 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.– GabrielJul 13, 2015 at 17:53
-
This method does not work as expected, it also hides the plank and wingpanel.– VladOct 11, 2019 at 8:15
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. Jul 13, 2015 at 17:40
-
1I disagree. Minimizing all windows is a completely different task than changing to a different workspace.– GabrielJul 13, 2015 at 17:54
-
@Gabriel Well, he is asking to view the desktop not minimize every window.– KultomJul 13, 2015 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.– GabrielJul 13, 2015 at 18:08
-
You can put the 'Desktop' docket to Plank (the dock application).
Ctrl+Right 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.
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.
-
-
1Its 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.– GabrielJul 13, 2015 at 15:33
-
-
@Tim What does "hide desktop" mean? Ie: this command:
wmctrl -k off
. What does it do?– GabrielJul 13, 2015 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
.– user3Jul 13, 2015 at 17:57
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.
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'
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 :)
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