Command line to change resolution? [Solved]

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
pewknee

Command line to change resolution? [Solved]

Post by pewknee »

I'd like to make a couple of desktop launchers to quickly change desktop resolution.

I thought xrander would do it but... no. Following tutorials on using xrandr, my output is not at all as expected. Is xrandr even the right way to go about this?

-Thanks!

Linux Mint, Mate
Nvidia something Mobile (nvidia-driver-390)
only one monitor

Edit: Just fyi, I want to switch resolutions like so:
640x480 before running Frozen Bubble
1024x576 before launching Steam
2880x1620 before anything else

And I can use the monitor preferences (mate-display-properties) but really... letting my children lose in control panels is not good for my laptop! I'm nervous about following the tutorials I'm finding for xrandr because they all eventually lead to checking/editing your xorg.conf file... which I thought was obsolete (my system doesn't have one by default). Thanks again for any help or pointers!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
gm10

Re: Command line to change resolution?

Post by gm10 »

While I am not sure your reasons for switching resolution are sound, here's how you do it with xrandr:

If you run xrandr without any parameters, it will give you a list of supported outputs and resolutions. Abridged example:

Code: Select all

HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  50.00    59.94  
   1024x768      75.03    70.07    60.00  
Now to switch that output to 1024x768:

Code: Select all

xrandr --output HDMI-1 --mode 1024x768
and back to 1920x1080:

Code: Select all

xrandr --output HDMI-1 --mode 1920x1080
pewknee

Re: Command line to change resolution?

Post by pewknee »

Woo! That did it. Thank you so much!

xrandr --output eDP-1-1 --mode 2880x1620 (normal)
xrandr --output eDP-1-1 --mode 640x480 (Frozen Bubble)


So now I have a little "rescue" launcher to get back to a usable desktop resolution, right in my panel.

Frozen Bubble runs in 640x480.
Not fullscreen, it's a little game window on my huge desktop. Fullscreen, it's a little game window floating in blackness. So I have to change the resolution to make the game playable, before launching the game... it's getting *back* to a normal resolution that's been difficult.

Similar story with Steam - there is no scaling for the Steam overlay/UI for Linux (that I can find anyhow), so I have to put on my reading glasses just to navigate.

Anyhow - this is perfect. Thanks again!

edit:
Frozen Bubble launching even better is:

sh -c "xrandr --output eDP-1-1 --mode 640x480 ; frozen-bubble --fullscreen"

Yay.
gm10

Re: Command line to change resolution?

Post by gm10 »

pewknee wrote: Mon Nov 05, 2018 6:49 pm Similar story with Steam - there is no scaling for the Steam overlay/UI for Linux (that I can find anyhow), so I have to put on my reading glasses just to navigate.
Is that the regular or the flatpak version? Because at least with the regular version the overlay is the same size as on Windows - unless there's a way to additionally scale it on Windows that I'm not aware of.
Locked

Return to “Other topics”