0

I do not want to know the resolution of my monitor. I would like to know the resolution of a fullscreen window running within Xorg.

For example, the resolution of Firefox when I maximise the window. This is different to the screen resolution because of the task bar. I need this so I can set a resolution for Wine's virtual desktop.

The xprop command surprisingly does not provide this. Are there any other commands I could use to determine this. Keep in mind, it can be any window.

2
  • 1
    The resolution of a fullscreen window is the resolution of the monitor. If your screen is split among multiple outputs/monitors, making a window full-screen will make the size of a single monitor by default. You can get all the data with xrandr -- including panning and size of the whole screen. It's not at all "surprising" that xprop didn't provide that info; xprop is used to set or get the X11 "properties" (chunks of data attached to windows).
    – mosvy
    Dec 13, 2018 at 20:47
  • xprop give you some informations : take a look at _NET_WM_STATE(ATOM) and _NET_WM_OPAQUE_REGION(CARDINAL)
    – ctac_
    Dec 14, 2018 at 5:26

1 Answer 1

1

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.

2
  • You should mention that wmctrl interrogates the window manager (hence WM). There are ways to determine screen resolution (xdpinfo, xrandr) that don't depend on a WM supporting wmctrl, nor do they depend on the application being maximized at the time you do the interrogation.
    – dirkt
    Dec 14, 2018 at 7:17
  • @dirkt from what I gathered ToffeeYogurtPots just wants to know the resolution that an application takes up but not the output from xrandr. I can expand this answer to include that information though. Thank you.
    – kemotep
    Dec 14, 2018 at 12:09

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.