How to get the x and the y size of Cinnamon desktop, without the task bar ?
How to get the x and the y size of Linux Mint Ubuntu Edition Cinnamon desktop, without the task bar (can be its called without gratification) ?
I have found 3 partly solutions. Partly solution 1: Code:
wmctrl -lG Code:
echo $x Code:
xdotool getwindowgeometry [FensterID z.B. 0x012345678] Code:
Window 012345678 Code:
xdotool getwindowgeometry 0x04000003 | grep Geometry Code:
Geometry: 1366x728 Code:
var="$( xdotool getwindowgeometry 0x04000003 | grep Geometry )" Code:
echo $x Code:
wmctrl -d Code:
0 * DG: 1366x768 VP: 0,0 WA: 0,0 1366x728 Workspace 1 Code:
wmctrl -d | grep "Workspace 1" Code:
0 * DG: 1366x768 VP: 0,0 WA: 0,0 1366x728 Workspace 1 Code:
echo $x |
A couple of examples for your first question using cut.
Code:
x=$(xdotool getdisplaygeometry | cut -d ' ' -f1 ) |
I would assume there is an X/Wayland way to do this that isn't specific to Mint or Cinnamon.
Yep, a quick search reveals xprop and _NET_WORKAREA which is calculated "by taking the current page minus space occupied by dock and panel windows" Code:
$ xprop -root _NET_WORKAREA _NET_DESKTOP_GEOMETRY |
Thanks, thats looking its on right way.
By the follow I get 1366 x 768 as output, but I need the range of the display ( in this case 1366 x 728 ) which dont have menus from Cinnamon and is available to show other windows. It can be I have to add the "wid" behind the "xdotool getdisplaygeometry" for this. Quote:
By follow one I dont get a output on this time: Quote:
|
Quote:
Code:
xprop -root _NET_WORKAREA Code:
echo "x=$x" Code:
x=$(xprop -root _NET_WORKAREA | tr -s ' ' | cut -d ' ' -f5) Code:
y=$(xprop -root _NET_WORKAREA | tr -s ' ' | cut -d ' ' -f6) |
There's plenty of ways to get just the relevant values, using cut/awk/grep/etc.
Possibly the simplest way to get them into separate variables is to use Bash "[[" and "=~" which performs a regex match and puts the captured groups into an array, for example: Code:
coords=$(xprop -root _NET_WORKAREA) |
Code:
_NET_WORKAREA(CARDINAL) = 0, 0, 1366, 728, 0, 0, 1366, 728, 0, 0, 1366, 728, 0, 0, 1366, 728 Code:
x=$(xprop -root _NET_WORKAREA | tr -s ' ' | cut -d ' ' -f5) Code:
x=$(xprop -root _NET_WORKAREA | cut -d ',' -f3) x= 1366 Code:
x=$(xprop -root _NET_WORKAREA | cut -d ',' -f3 | xargs echo -n) The "tr -s ' ' " command was used to "shrink" the number of white spaces between numbers in the other commands but not necessary with xprop. |
Quote:
Thanks for this and the guide to do this in future possible by self. Thanks Thanks for the other solutions from other people too. THX |
All times are GMT -5. The time now is 05:59 PM. |