You have a few different options. However, I believe wmctrl
will give you the best results. As pointed out by user dirkt this tool is dependent on your Window Manager supporting it.
wmctrl -lG | grep [Name of Application]
Will give you the x,y offsets, width and height in pixels of a given application. I got the answer from this AskUbuntu post.
You should also look into the output of xdpyinfo
and xwininfo
. These are tools for X server that can tell you various points of information about a given X window or application. Doing something like the following will give you highly accurate information about your display:
xdpyinfo | more
You then want to scroll down to screen #0 and you get all of the details from screen size in pixels to dpi, etc. Very accurate to your current X settings.
Additionally there is xwininfo
. This will tell you statistics of a given window application too.
There is also this Unix and Linux post that is relevant to this post. They use additional scripts but you can get relatively accurate information using xdotool getactivewindow getwindowgeometry
.
You report that you are going to be using applications in full screen. As user mosvy points out, your xrandr
output of your screen will be the exact dimensions of your monitor and thus any full screen application.
xrandr
-- including panning and size of the whole screen. It's not at all "surprising" thatxprop
didn't provide that info; xprop is used to set or get the X11 "properties" (chunks of data attached to windows). – Dec 13 '18 at 20:47