Screen resolution changed after changing it in a program
- Inicie sesión o regístrese para enviar comentarios
I use i3wm, and here's what I've put in my config file:
exec_always --no-startup-id xrandr --output HDMI2 --left-of LVDS1
The problem is, aftertrying SuperTux and changing the resolution, it changed for the whole computer.
I remember managing to change it back in the game.
But now the same thing happened while trying openxcom (non-free assets, but the rest is), yet I can't change it back. Unfortunately I can't even remember how I did it since before that I changed the in-game resolution so many times without trouble.
Of course, I could restart the computer. I started to refresh my i3config file, but no success.
I also remember having a screen assignment change when on and off the Ultrabase (it's a Thinkpad), which I didn't solve yet. But if I can reset the xrandr display without trouble, this might solve half of the latter issue, and the whole of the first one.
Alternatively, can I script a specific resolution for when the game is turned on, and when off, back to the latter config? Then I'll be able to play full screen, full speed, no CPU screams, and keep my standard screen resolution when not playing.
It seems reloading my config (thus the xrandr command) gives me back non-mirrored display, which appears when launching the game (but it's the perfect setting to play).
Yet the resolution is still off (too big).
EDIT:
After further testing, restarting the computer gives me my initial config back.
Launching the game switches to mirrored screen, and bigger resolution since when I turn the game off, everything looks bigger on screen.
Worst, I refresh my i3config in order to get rid of the mirrored screen at least, but it went kinda blank, and very little worked: my alt key worked (displays the hidden bar), and that's it.
I've reset the game's config file. I have no issues when I quit it now, but I still want to be able to change the screen resolution only when this or that program is on (and change back when I leave it).
SuperTux does the exact same thing. I just used the full screen option. Even after removing it, same issue: mirrored screen, and when I refresh my i3config (which contains the xrandr command) everything is bigger on screen (specially the external screen, the laptop display seems unaffected), though the mirrored screen is gone (meaning both screens act as one).
EDIT: I found this to get my resolution back:
xrandr -s 0
which is size back to zero it seems, but it actually resets the size of the laptop screen only, as if the external screen was unplugged.
But this supposedly fixes the screen issue when I remove it from the Ultrabase.
Maybe I need to specify my screen with the --output option first.
EDIT2:
--auto at the end of my xrandr command works just right.
Fully tested.
Assuming it works, ideally, I still need to know the trigger that indicates a removal or insertion into the Ultrabase, but also the opening/closing of a specific application, say, Supertux.
Probably the easiest solution with games that exhibit this issue is to write launch scripts that contain the resolution reset command at the end.
Detecting the docking station is a lot trickier. You can check dmesg and the connect it and recheck dmesg to see what it saw. Other parts of the solution might include acpi or udev or incron watching for specific changes in /sys, /proc or /dev. For example your docking station might come with extra usb ports and as a hacky solution you could use the usb port count as an indicator.
But this means then that the game will play with the right (chosen) resolution. The only downside is that I actually like how it looks with the smaller resolution.
I just want to get back at the normal resolution when leaving the game. Actually this exactly but when closing the game would be perfect.
So far, the command from the CLI works every time.
But with openxcom, if the command is in my i3 config file, then something weird happens: it's like going back to GDM if I had it, i.e. leaving the session.
Thanks for the info about the Ultrabase. I'll see what I can find.
- Inicie sesión o regístrese para enviar comentarios