Wine/Steam on Linux: change resolution on the fly in gaming (Age of Empires II 2013)

pioruns

n00b
Joined
Sep 11, 2018
Messages
28
Hi all,

I wanted to share something for those Linux friends who play on Wine or Steam.
Recently I stumbled upon a game which stubbornly didn't have any resolution change setting - Age of Empires II (2013). I have 4K monitor with 139.87 PPI. Units are tiny and interface in that resolution is unplayable. So I wrote simple script, to change resolution and reposition my all 3 monitors, run the game, and after game is finished, press Enter to revert resolution back to what it was.

Code:
#!/bin/bash

echo Lower main 4K screen resolution to 1680x1050
xrandr --output DP-3   --mode 1280x1024 --pos 0x0
xrandr --output DP-0   --mode 1680x1050 --pos 1280x0
xrandr --output HDMI-0 --mode 1920x1080 --pos 2960x0

echo Start Age of Empires II (2013)
steam steam://rungameid/221380

echo Press [Enter] to restore resolution back to normal
read

echo Restore main 4k screen resolution
xrandr --output DP-3   --mode 1280x1024 --pos 0x1136
xrandr --output DP-0   --mode 3840x2160 --pos 1280x0
xrandr --output HDMI-0 --mode 1920x1080 --pos 5120x1080

To learn your current setting (and monitor positions), just type xrandr. Then you can populate entries in your own script.
If you have only one monitor, then you can simply put one xrandr line without --pos (position of the monitor) and another xrandr to revert resolution back. Also replace steam line with your steam game or wine command.

Enjoy :)
 

jonneymendoza

Supreme [H]ardness
Joined
Sep 11, 2004
Messages
6,276
Hi all,

I wanted to share something for those Linux friends who play on Wine or Steam.
Recently I stumbled upon a game which stubbornly didn't have any resolution change setting - Age of Empires II (2013). I have 4K monitor with 139.87 PPI. Units are tiny and interface in that resolution is unplayable. So I wrote simple script, to change resolution and reposition my all 3 monitors, run the game, and after game is finished, press Enter to revert resolution back to what it was.

Code:
#!/bin/bash

echo Lower main 4K screen resolution to 1680x1050
xrandr --output DP-3   --mode 1280x1024 --pos 0x0
xrandr --output DP-0   --mode 1680x1050 --pos 1280x0
xrandr --output HDMI-0 --mode 1920x1080 --pos 2960x0

echo Start Age of Empires II (2013)
steam steam://rungameid/221380

echo Press [Enter] to restore resolution back to normal
read

echo Restore main 4k screen resolution
xrandr --output DP-3   --mode 1280x1024 --pos 0x1136
xrandr --output DP-0   --mode 3840x2160 --pos 1280x0
xrandr --output HDMI-0 --mode 1920x1080 --pos 5120x1080

To learn your current setting (and monitor positions), just type xrandr. Then you can populate entries in your own script.
If you have only one monitor, then you can simply put one xrandr line without --pos (position of the monitor) and another xrandr to revert resolution back. Also replace steam line with your steam game or wine command.

Enjoy :)
Does this work on any steam game?

Having problems with the pes 2020 game
 

pioruns

n00b
Joined
Sep 11, 2018
Messages
28
Yes. Changing resolution is universal and works everywhere - basically this script changes resolution for you (so you don't need to go to Display settings in Linux menu) and then runs your game and then reverts resolution back to what it was. You just need to adjust it to your resolution and find path to game launcher.
 
Top