Some applications behave differently at a different screen resolution. Is there any way to get the system to report a different, user-specified, resolution to a GUI application when starting it?

By behave differently I mean for example their unresizable window is smaller (not necessarily physically, for obvious reasons, but fewer pixels) if I first switched the monitor to a lower resolution.

Something like:

~$ sudolution 800x600 unresizableapp

Or is there any method to force-resize unresizable windows?


I doubt a fake resolution can be provided somehow. The resolution can be received from X extension RANDR, e.g. with the tool xrandr.

What you can do instead:

  • For resolutions smaller than current screen:

Use a nested X server like Xephyr with a custom resolution:

Xephyr :5 -retro -screen 400x300x24

Run desired application with DISPLAY=:5 application. It makes sense to run a window manager on :5, too. (400x300 is the resolution, x24 is color depth.)

  • For resolution bigger than current screen:

Change current screen to have a virtual bigger display:

xrandr --output VGA-1 --panning 3000x2000

Replace example VGA-1 with an output name given in output of xrandr. To turn panning of, run with --panning 0x0.

| improve this answer | |
  • Xvfb is another option but only if you don't need to see what's happening or are prepared to use something like VNC to look in. – Jasen Jul 21 '18 at 6:47
  • Are there ways in which using a nested X server is better than using VNC? – argle Jul 21 '18 at 7:19
  • @argle Xephyr is immediatly visible and fast. VNC needs a server and a viewer, needs more resources and is slow. – mviereck Jul 21 '18 at 15:46

There is a difference between the size in pixels of a screen, and the resolution in pixels per inch. Your pseudo solution seems to want to change the size, not the resolution.

You can use xrandr to change the reported resolution of the screen with option --dpi.

| improve this answer | |
  • Some applications are programmed to take up "as much of the screen as possible anyway". A resolution-oriented solution, as opposed to a DPI-oriented solution, is the only way. – argle Jul 21 '18 at 7:59

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.