How Do I Save Xrandr Settings?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
AlbertP
Level 16
Level 16
Posts: 6701
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: How Do I Save Xrandr Settings?

Post by AlbertP »

I think you're indeed right.

What can be done to have a command executed every time, is adding it in Startup Programs (in Cinnamon or MATE, don't know if other desktops include such a program). Two commands can be concatenated using a && sign: use command1 && command2 to have both executed in the right order at login.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
cwsnyder

Re: How Do I Save Xrandr Settings?

Post by cwsnyder »

@AlbertP, one warning: the double-ampersand (&&) will not execute the second command unless the first command executes without error.
AlbertP
Level 16
Level 16
Posts: 6701
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: How Do I Save Xrandr Settings?

Post by AlbertP »

That's right, but if the first of the two xrandr commands mentioned, returns an error then trying the second one doesn't make sense anyway.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
fgtome
Level 1
Level 1
Posts: 1
Joined: Fri May 20, 2022 3:52 pm

Re: How Do I Save Xrandr Settings?

Post by fgtome »

asobczak wrote: Thu Nov 15, 2012 12:09 pm Hi,
In my case it works this way:
I create a file 91_custom_xrandr and place it in directory /etc/X11/Xsession.d
Be carefull about names in this directory, since they have to follow the rules described in man Xsessions
file content:
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode HDMI1 1920x1080_60.00
Restart machine and voila!


PS I spend too much time on reading and trying, me dumb newbeeee, so tell me it works for you :evil:
Hi,

I just registered in the forum to give my feedback. This fix works in Linux Mint 20.3 Cinnamon :D !!

I have an HP V24 FHD monitor. I plugged my old laptop into the D-SUB input, but could only get listed 800x600 and 1024x768. So after reading a couple of posts, I read your solution, and worked like a charm for me... this is what I did:

1) created a file using the name 91_custom_xrandr (as sudo) inside the directory /etc/X11/Xsession.d with the following content:

Code: Select all

randr --newmode "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084>
xrandr --addmode VGA-1 "1920x1080_60.00"
2) Restarted my system. The login keeps the old resolution (1024x768), and after I inserted my password, the system has not updated the new resolution. So I go to Preferences - Display, and now I have a new option available that allows me to have 1920x1080. I set it and apply to the new configuration.

3 To test everything, I rebooted again. The login windows is using 1024x768, but once I login automatically the system applies the 1920x1080... great!

So, thank you very much for your tip! 8)
User avatar
SMG
Level 25
Level 25
Posts: 31776
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: How Do I Save Xrandr Settings?

Post by SMG »

fgtome wrote: Fri May 20, 2022 4:09 pmI just registered in the forum to give my feedback. This fix works in Linux Mint 20.3 Cinnamon :D !!
We really prefer you use up-to-date information instead of something from 11 years ago. There is much newer information available on the forum and you should use something which is specifically for the version of Linux Mint you are using instead of something from more than a decade ago.

Nowadays, we advise people to just add those xrandr commands to the end of their .profile file (a hidden file in the home directory). It will automatically take effect when you log in. No need to create new files or go through the extra steps of changing settings in the Display app.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
Locked

Return to “Graphics Cards & Monitors”