I'm curious how I can get information such as the dimensions of my desktop, which desktop is currently active, and what labels (if any) are set for my desktop enviornment (DE).
Command Line – Get Information About Virtual Desktops
command linedesktopfreedesktopscriptingx11
Best Answer
Using the tool
wmctrl
you can get all the above information, specifically the-d
switch.Example
Details
One line is output for each desktop, with the line broken up into space separated columns.
Extra Cool things you can do with wmctrl
list info about Window Manager
list active windows
One line is output for each window, with the line broken up into space separated columns.
-p
option is specified the next column will contain the PID for the window as a decimal integer.-G
option is specified then four integer columns will follow: x-offset, y-offset, width and height.-p
switch example-G
switch example*NOTE: The
-p
and-G
switches can also be combined!switching to a different desktop
NOTE: Desktops are numbered starting at 0, so 1 would be the 2nd.
reduce the number of desktops
We now have 3 instead of 4.
Now put it back to 4.
Closing a window