How Do I Save Xrandr Settings?

Screen resolution, 3D Acceleration, nVidia, ATI
Forum rules
Before you post please read this

How Do I Save Xrandr Settings?

Postby DasFox on Wed Feb 09, 2011 3:47 am

I'm running nouvuea with 2.6.36.3 I compiled into a .deb package and installed and after running these cmds for my rez setup;

cvt 1680 1050
sudo xrandr --newmode 1680x1050 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr --addmode VGA-1 1680x1050

I can't get the settings to stay adding them anywhere I've tried.

These are all the steps I've tried below that didn't work...

/etc/gdm/Init/Default at this line;

xrandr --output VGA-1 --mode 1680x1050
/sbin/initctl -q emit login-session-start DISPLAY_MANAGER=gdm

I also placed it like this in /etc/gdm/Init/Default that didn't work either;

PATH="/usr/bin:$PATH"
OLD_IFS=$IFS

xrandr --newmode 1680x1050 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr --addmode VGA-1 1650x1080_60.00
xrandr --output VGA-1 --mode 1650x1080


Then I placed these two cmds in .xinitrc, .Xdefault and .xprofile with no success;

xrandr --newmode 1680x1050 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr --addmode VGA-1 1650x1080_60.00


Next I tried arandr and when I log out of X and try to load the file I saved it complains that it can't find the mode for 1680x1050.

Next I added them in the 'Preferences' 'Startup Applications', as;

/home/user/.config/misc/auto_start.sh, with these cmds below in auto_start.sh in it, this worked when I logged into Gnome but it killed my mouse from working;

xrandr --newmode 1680x1050 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr --addmode VGA-1 1650x1080_60.00


Plus I tried adding this into rc.local as /home/user/.config/misc/auto_start.sh and still no luck.

No matter what I've tried nothing works, the only thing slightly close is this executable script which works if I run it by hand so I know this will work, but I can't seem to get it
to load at startup...

Does anyone know how I can get this xrandr settings to be saved and load at startup?


THANKS
DasFox
Level 3
Level 3
 
Posts: 151
Joined: Thu Apr 05, 2007 4:04 am

Linux Mint is funded by ads and donations.
 

Re: How Do I Save Xrandr Settings?

Postby cronfy on Thu Apr 21, 2011 7:58 am

I had same issue with nouvuea and two monitors, one is connected via DVI -> VGA converter and it's modes are not detected correctly.

I found correct "--newmode" parameters by connecting that monitor directly to VGA port and executing

Code: Select all
xrandr --verbose


(see man xrandr for --newmode syntax and examples)

Then I added these lines to /etc/gdm3/Init/Default:

Code: Select all
xrandr --newmode "my1280" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +HSync +VSync
xrandr --addmode DVI-I-1 my1280


Right before last line:

Code: Select all
exit 0


After reboot I just set up two monitors and these setting are now kept across reboots.
cronfy
Level 1
Level 1
 
Posts: 3
Joined: Mon Jan 17, 2011 11:57 am

Re: How Do I Save Xrandr Settings?

Postby danardf on Fri Nov 09, 2012 1:44 am

Hi.

I tried to apply this way, but unfortunatelly, it not works.
There is several ways on the web to trying to save this kind of stuff, but i can see that's not really easy and efficient.

I use a Samsung syncmaster 933HD.
All works fine after these cmd:

xrandr --newmode "1360x768" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync
xrandr --addmode VGA-0 "1360x768"
xrandr --output VGA-0 --mode 1360x768


But in your comments, i cannot see /etc/gdm3/ folder. So....

Also, i tried to add this file : .config/autostart/autostart.sh including xrandr -s 1360x768 -r 60, but no luck.

It's wierd to have a nice OS without be able to set resolution, and save easily our custom configuration.
I cannot count how many distro aren't able to customise any resolution during installation. It's always a battle.

If you could help me, it will be great. :D

Regards

Franck
danardf
Level 1
Level 1
 
Posts: 5
Joined: Wed Nov 07, 2012 2:33 am

Re: How Do I Save Xrandr Settings?

Postby cwsnyder on Fri Nov 09, 2012 6:49 am

Any answer is very much going to depend on which login manager you are using. Putting things in /etc/gdm3/Init/Default only works if you are using the gdm3 login manager for a gtk desktop. If you are using, say lightdm (also gtk), kdm for qt based desktops, or xdm (which is for any desktop), the place to put the commands will vary. At least you can use xrandr. If you enter xrandr on a line by itself and the response begins the second line with default, xrandr often won't work, and I am still researching to find a method to fix this type of problem.

For Lightdm, you need to add the lines in /etc/lightdm/lightdm.conf
Code: Select all
[SeatDefaults]
#xserver-command=X
#xserver-layout=
#xserver-config=
xserver-allow-tcp=false
#xdmcp-manager=
#xdmcp-port=177
#xdmcp-key=
greeter-session=lightdm-greeter
greeter-hide-users=true
#greeter-allow-guest=true
#greeter-show-manual-login=false
#user-session=default
# for the login screen on lightdm
[newline]display-setup-script=/usr/share/videomode.sh[/newline]
# for the desktop session
[newline]session-setup-script=/usr/share/video2.sh[/newline]
#allow-guest=true
#guest-session=UNIMPLEMENTED
session-wrapper=/etc/X11/Xsession
#display-setup-script=
#greeter-setup-script=
#session-setup-script=
#session-cleanup-script=
#autologin-guest=false
#autologin-user=
#autologin-user-timeout=0
#autologin-session=UNIMPLEMENTED
#exit-on-failure=false
Where videomode.sh is a shell script which is executable with your xrandr --newmode / xrandr --addmode / and xrandr --output lines, but video2.sh is simply an executable shell script with the xrandr --output line. You then, when you get to your desktop need to use your Display menu setting to set the newly available mode for it to be (semi-)permanent. Reference http://askubuntu.com/questions/63681/ho ... -permanent

In Xdm for Debian based distributions, the config file is usually found in /usr/X11R6/lib/X11/xdm/xdm-config and I found a reference http://forums.debian.net/viewtopic.php?t=20201 stating that the proper place to put your commands is in /etc/X11/xdm/Xsetup

According to the Ubuntu Wiki at http://manpages.ubuntu.com/manpages/luc ... kdm.1.html, for kdm, the config file to put your xrandr lines in would be /etc/kde4/kdm/Xstartup (script to run as root before session starts) unless you need to have it run earlier to get a usable display for login.
LMDE Mate 64-bit, LM16 Mate 64-bit
Debian Xfce 64-bit, Xubuntu 13.10 64-bit, Xubuntu Trusty Tahr 64-bit, Antergos Xfce 64-bit, PCLinuxOS LXDE 64-bit
cwsnyder
Level 6
Level 6
 
Posts: 1039
Joined: Wed Oct 20, 2010 6:49 am
Location: Nappanee, IN, USA

Re: How Do I Save Xrandr Settings?

Postby danardf on Fri Nov 09, 2012 11:25 am

hmmm thanks for these explanations, :)

unfortunatelly, nothing right.

At first, i added some lines into : /etc/lightdm/lightdm.conf , like this:
Code: Select all
[SeatDefaults]
greeter-session=unity-greeter
user-session=cinnamon
display-setup-script=/usr/share/videomode.sh
session-setup-script=/usr/share/video2.sh


Next, i just created 2 files, like this:
/usr/share/videomode.sh
Code: Select all
xrandr --newmode "1360x768"  84.72  1360 1424 1568 1776  768 769 772 795  -HSync +Vsync
xrandr --addmode VGA-0 "1360x768"


/usr/share/video2.sh
Code: Select all
xrandr --output VGA-0 --mode 1360x768


Applying chmod a+x for both under root.

I restarted my LinuxMint station, but nothing changed. :?

thanks for your help :wink:
danardf
Level 1
Level 1
 
Posts: 5
Joined: Wed Nov 07, 2012 2:33 am

Re: How Do I Save Xrandr Settings?

Postby cwsnyder on Fri Nov 09, 2012 6:35 pm

Did you check in your Display settings to see if your new mode has been set in your display selections?

My resolution did not change on reboot, but when I checked in the Display settings, there was a selection for the higher resolution in the pull-down menu.
LMDE Mate 64-bit, LM16 Mate 64-bit
Debian Xfce 64-bit, Xubuntu 13.10 64-bit, Xubuntu Trusty Tahr 64-bit, Antergos Xfce 64-bit, PCLinuxOS LXDE 64-bit
cwsnyder
Level 6
Level 6
 
Posts: 1039
Joined: Wed Oct 20, 2010 6:49 am
Location: Nappanee, IN, USA

Re: How Do I Save Xrandr Settings?

Postby danardf on Sat Nov 10, 2012 3:44 am

Hi.

Did you check in your Display settings to see if your new mode has been set in your display selections?


Hmmm yes, before to change, i had some resolution up to 1024x768.
After change, my new resolution appears into the list.

My resolution did not change on reboot, but when I checked in the Display settings, there was a selection for the higher resolution in the pull-down menu.


Hmmm, my resolution stays on 1024x768 max.
So, my parameters aren't saved. :(

Thanks

Regards :wink:
danardf
Level 1
Level 1
 
Posts: 5
Joined: Wed Nov 07, 2012 2:33 am

Re: How Do I Save Xrandr Settings?

Postby cwsnyder on Sat Nov 10, 2012 7:30 am

Do I understand you correctly that you have the selection of 1360x768 on your display list, but you can't make that selection? Or is it that when you make that selection your display goes bonkers?
LMDE Mate 64-bit, LM16 Mate 64-bit
Debian Xfce 64-bit, Xubuntu 13.10 64-bit, Xubuntu Trusty Tahr 64-bit, Antergos Xfce 64-bit, PCLinuxOS LXDE 64-bit
cwsnyder
Level 6
Level 6
 
Posts: 1039
Joined: Wed Oct 20, 2010 6:49 am
Location: Nappanee, IN, USA

Re: How Do I Save Xrandr Settings?

Postby AlbertP on Sat Nov 10, 2012 7:31 am

If you need any xrandr commands in terminal to get the correct resolution, then you can put those commands in the .xinitrc file in your home folder to have them executed every time you login.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
AlbertP
Level 16
Level 16
 
Posts: 6517
Joined: Sun Jan 30, 2011 12:38 pm
Location: The Netherlands

Re: How Do I Save Xrandr Settings?

Postby danardf on Mon Nov 12, 2012 3:21 pm

cwsnyder wrote:Do I understand you correctly that you have the selection of 1360x768 on your display list, but you can't make that selection?


No, When i'm loging, at fist i've this:
Image

Next, I launch my 2 scripts like this. (faster) :)
Image

Next, i can see my new resolution, like this:
Image

And finally, i've this list:
Image

cwsnyder wrote:Or is it that when you make that selection your display goes bonkers?


No, when i select my resolution, all works fine.
But, when i restart the station, i lose my new resolution (1360x768).

Regards
danardf
Level 1
Level 1
 
Posts: 5
Joined: Wed Nov 07, 2012 2:33 am

Re: How Do I Save Xrandr Settings?

Postby cwsnyder on Mon Nov 12, 2012 4:36 pm

I am using Lightdm with LMDE Xfce, and I put my scripts and pointers in the /etc/lightdm/lightdm.conf file and the results were exactly the same as when I did it with Lightdm in my Debian Wheezy installation. That is, I had to login the first time, select the default resolution which I wanted, and was available from both Menu >> Settings >> Display and Arandr without re-running my scripts, then reboot and my next login I had my default display resolution set where I wanted it.

The big problem I see is that you have to run your scripts again after you login.

I had a late thought. I had a problem with my gdm3 LMDE installation, the colors for my password were white on light-grey, so I fired up Synaptic and loaded Lightdm, since that was what my Debian Wheezy install used. The result was that my login screen was usable again. As I said, I added the scripts which I wrote because my monitor's EDID is not recognized and added the pointers in /etc/lightdm/lightdm.conf as I show above and everything worked.

You may want to consider changing your login manager from gdm3 to either lightdm or xdm and see if they work better.
LMDE Mate 64-bit, LM16 Mate 64-bit
Debian Xfce 64-bit, Xubuntu 13.10 64-bit, Xubuntu Trusty Tahr 64-bit, Antergos Xfce 64-bit, PCLinuxOS LXDE 64-bit
cwsnyder
Level 6
Level 6
 
Posts: 1039
Joined: Wed Oct 20, 2010 6:49 am
Location: Nappanee, IN, USA

Re: How Do I Save Xrandr Settings?

Postby AlbertP on Tue Nov 13, 2012 4:20 am

Have you already tried putting the two commands in the .xinitrc file in your home folder (create it if it doesn't exist) like I said?
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
AlbertP
Level 16
Level 16
 
Posts: 6517
Joined: Sun Jan 30, 2011 12:38 pm
Location: The Netherlands

Re: How Do I Save Xrandr Settings?

Postby asobczak on 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:
Intel® Sandybridge Desktop 64b Intel® Core™ i3-2120 CPU @ 3.30GHz × 4 MEM 3,8 GiB
Kernel 3.10-2-amd64 x86_64 (64 bit) Distro Linux Mint Debian Edition
Distribution : Linux Mint Debian Edition
User avatar
asobczak
Level 1
Level 1
 
Posts: 30
Joined: Sun Jun 10, 2012 5:32 pm
Location: Warsaw, Poland

Re: How Do I Save Xrandr Settings?

Postby danardf on Fri Nov 16, 2012 5:00 am

asobczak wrote: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:


Yesss. thanks a lot.
Works fine now... :D

Have a nice day, and thanks again at all for your help. :wink:

Regards
danardf
Level 1
Level 1
 
Posts: 5
Joined: Wed Nov 07, 2012 2:33 am

Re: How Do I Save Xrandr Settings?

Postby asobczak on Fri Nov 16, 2012 5:42 am

I am glad it works for you.
Enjoy your Mint ;)
PS Mark thread Solved
Intel® Sandybridge Desktop 64b Intel® Core™ i3-2120 CPU @ 3.30GHz × 4 MEM 3,8 GiB
Kernel 3.10-2-amd64 x86_64 (64 bit) Distro Linux Mint Debian Edition
Distribution : Linux Mint Debian Edition
User avatar
asobczak
Level 1
Level 1
 
Posts: 30
Joined: Sun Jun 10, 2012 5:32 pm
Location: Warsaw, Poland

Re: How Do I Save Xrandr Settings?

Postby gadien on Mon Mar 18, 2013 1:49 am

AlbertP wrote:If you need any xrandr commands in terminal to get the correct resolution, then you can put those commands in the .xinitrc file in your home folder to have them executed every time you login.


I have found a page that gives a detailed outline to what needs to be done for Linus Mint 13 (Maya):
http://community.linuxmint.com/tutorial/view/877
gadien
Level 1
Level 1
 
Posts: 1
Joined: Sun Mar 17, 2013 9:20 am

Re: How Do I Save Xrandr Settings?

Postby jojopumpkin on Wed Sep 11, 2013 7:37 am

asobczak wrote: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:


This worked for me using Mint KDE (15). Thanks @asobczak
jojopumpkin
Level 1
Level 1
 
Posts: 14
Joined: Fri Jul 24, 2009 1:15 am

Re: How Do I Save Xrandr Settings?

Postby maxcel on Tue Nov 26, 2013 5:03 pm

asobczak wrote: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!
[/quote]

This worked for me on Linux Mint 16 MATE. Thank you.
maxcel
Level 1
Level 1
 
Posts: 3
Joined: Mon Dec 05, 2011 9:59 am

Re: How Do I Save Xrandr Settings?

Postby swastik on Sat Dec 07, 2013 7:44 am

asobczak wrote: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:



Worked for me as well :D on a dual monitor/screen set-up that too

Many thanks.
swastik
Level 1
Level 1
 
Posts: 2
Joined: Thu Feb 03, 2011 11:53 am

Re: How Do I Save Xrandr Settings?

Postby amphibole on Thu Dec 19, 2013 3:54 am

Hi! Congratulations to the OP. Glad it is working. I'm working on a similar problem tonight and found this thread. I'm using LMDE, btw.

On Nov 13 2012 was posted post 647413:
AlbertP wrote:Have you already tried putting the two commands in the .xinitrc file in your home folder (create it if it doesn't exist) like I said?


Specifically in answer to AlbertP and for the sake of others who read the thread: I don't believe that will ever work when you are using any X dm to login to your graphical session -- but please read what I am saying carefully, though, before just contradicting my statement.

My understanding is that modern X-using systems do not use .xinitrc for the majority of approaches to logins. Say, I could just stop here but instead I am going to go the extra mile to explain my meaning fully. I'd appreciate it if the reader would either ignore the posting entirely or else read it fully. Not something halfway in-between.

Oh, and if the suspicion is that I am wrong - that I am a 100% confused chucklehead, instead of the 33% or so that I actually am :P ...note that the OP mentioned that putting his xrandr ... commands in an ~/.xinitrc file did not provide the solution, as I'd expect he'd report.

If I was kinda a new user I might think that AlbertP had a point because the ~/.xinitrc file is mentioned all over the place in offline and online (WWW) documentation. Be careful. Much of what one finds is obsolete documentation that just needs to be archived somewhere but otherwise marked "BEWARE, THIS WILL ONLY CONFUSE YOU IN 2012." I've spent uncounted hours over the years checking this kind of documentation. I may not have everything right for every case, yet, but I have a pretty good overall idea.

What's wrong with ~/.xinitrc is that it is a relic from the days when people did not use modern X display managers and much of what those managers (together with the desktop session managers that you are switched to when you've authenticated / logged in) do, does replace what people in olden times used the ~/.xinitrc file for.

RTFM the manpage for xinit to see the authoritative description of how ~/.xinitrc is used.

If xinit is not being invoked ...and modern login defaults provided by refined GNU/Linux distros like LinuxMint do not involve invocation of xinit; instead a process owned by root is started (at the appropriate runlevel) that invokes an X11 Display Manager, a dm ...so then why would an ~/.xinitrc file have any effect?

I actually have an ~/.xinitrc because I actually run xinit on some occasions. I have specific reasons for doing so. My observation is therefore based on actual experience on several different current systems, is true across several distros, and my experience is that except when xinit is invoked from the linux console, ~/.xinitrc can either exist or not exist, can contain anything at all if it does exist, and will have no effect whatsoever.

Cheers!
All unaccompanied children will be given espresso and a free kitten.
amphibole
Level 1
Level 1
 
Posts: 4
Joined: Tue May 07, 2013 2:30 pm

Linux Mint is funded by ads and donations.
 
Next

Return to Graphic Cards & Monitors

Who is online

Users browsing this forum: No registered users and 4 guests