[Tutorial] Run Linux programs in a resolution, then restore after closing

Kippykip

Get out of my kitchen you flying ass
cringge
First off, open a terminal and type xrandr, scroll up and it'll show the name of your display here:
wQ29Otq.png


Then for your program, you'll want to make a launcher on your desktop or something, and for the command line use this template:

bash -c "xrandr --output VGA-1 --mode 640x480 && /path/to/program/ && xrandr --output VGA-1 --preferred"

The parts in bold you need to change, VGA-1 becomes the display name listed from the xrandr command you typed before. And change 640x480 to the resolution you want.

Here's an example of my DuckStation launcher (PSX emulator)
cvV34WZ.png


DuckStation.desktop
Code:
[Desktop Entry]
Version=1.0
Type=Application
Name=DuckStation
Comment=
Exec=bash -c "xrandr --output LVDS-1 --mode 640x480 && /home/kippykip/PSX/DuckStation && xrandr --output LVDS-1 --preferred"
Icon=input-gaming
Path=
Terminal=false
StartupNotify=true
 
Top