xrandr on boot? [SOLVED]

Forum rules
Before you post please read how to get help

xrandr on boot? [SOLVED]

Postby jage on Mon Oct 31, 2011 4:15 pm

I use
Code: Select all
xrandr --output VGA-0 --primary

to make my monitor primary over my laptop screen, but noticed it is not persistent on booting.

Is there somewhere to put this in a boot sequence, or somewhere to record this as a preference?
Last edited by jage on Thu Nov 03, 2011 11:59 am, edited 1 time in total.
jage
Level 1
Level 1
 
Posts: 24
Joined: Sun Oct 30, 2011 1:11 am

Linux Mint is funded by ads and donations.
 

Re: xrandr on boot?

Postby xenopeek on Tue Nov 01, 2011 7:02 am

Sure, you need to make a script and have it run during the X server initialization. Taking your piece of code, the following is how you could do this. Open a terminal and run:
Code: Select all
mkdir ~/Scripts
gedit ~/Scripts/setoutput.sh

Put the following two lines in the script.
Code: Select all
#!/usr/bin/env sh
xrandr --output VGA-0 --primary

Then save & close the file and run the following commands to finish the setup:
Code: Select all
chmod +x ~/Scripts/setoutput.sh
sudo ln -s ~/Scripts/setoutput.sh /etc/X11/Xsession.d/45setoutput
User avatar
xenopeek
Level 21
Level 21
 
Posts: 15696
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: xrandr on boot?

Postby jage on Thu Nov 03, 2011 12:48 am

You know in Control Center under Personal there is a "Startup Applications" and typing the xrandx command as written there worked smashingly.

I appreciate the script advice, but I'm a GUI guy and if I can do something without terminal I'd rather (I know, heresy of the worst kind...)

Anyway, just mentioning it in case this turns up in someone's search.
jage
Level 1
Level 1
 
Posts: 24
Joined: Sun Oct 30, 2011 1:11 am

Re: xrandr on boot?

Postby xenopeek on Thu Nov 03, 2011 4:48 am

Okay, if that works use it :wink: The xrandr script is especially applicable to people needing to change resolution. If you do that from Startup Applications, sometimes the desktop doesn't handle this right and, in addition to one more mode set (flicker of screen), it happens that panel applets get aligned wrong on the panel if you do it through Startup Applications.
User avatar
xenopeek
Level 21
Level 21
 
Posts: 15696
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: xrandr on boot? [SOLVED]

Postby jage on Fri Nov 04, 2011 12:30 pm

Well eventually I came around to needing to change the resolution and this really helped. I followed these instructions to get my resolution commands:
http://www.ubuntugeek.com/how-change-di ... randr.html

With the codicil that you reboot and don't touch the GUI monitor, but go directly into terminal.

Once the 3 commands are built, I used Vincent's instructions to implement them on boot. For myself I have dual monitors so I actually had six lines of code, plus the shell line from Vincent's example:
Code: Select all
#!/usr/bin/env sh
xrandr --newmode "1280x800_60.00" 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync
xrandr --addmode VGA-0 1280x800_60.00
xrandr --output VGA-0 --mode 1280x800_60.00

xrandr --newmode "800x500_60.00"   30.75  800 824 896 992  500 503 509 521 -hsync +vsync
xrandr --addmode LVDS 800x500_60.00
xrandr --output LVDS --mode 800x500_60.00


I left the primary output in startup applications and it still works. Be sure to follow the URL instructions and use cvt to build your resolution, and stay away from the GUI monitor (if you get an error after "just checking" in the GUI just reboot)

Now I need to go back and fix that 800x500... not quite the perfect resolution for my secondary monitor yet.
jage
Level 1
Level 1
 
Posts: 24
Joined: Sun Oct 30, 2011 1:11 am

Re: xrandr on boot? [SOLVED]

Postby jvdurme on Thu Jan 05, 2012 6:58 pm

Hi all,

I tried the script solution, but it didn't work for me.
I'm using MATE, have an ATI Radeon 3650 (notebook) and want to set screen resolution to 1440x900 with:

xrandr --output LVDS --mode 1440x900 --rate 50

Unfortunately, when I do all the steps from above, screen stays at 1920x1200.

The Startup Applications thingy worked surprisingly. I did have 5 warnings about panel applets in error. But doing 5 times "killall mate-panel" made the errors go away. Still haven't seen them again.

There was also a lightdm.conf option, but also didn't work for me:

http://www.sudo-juice.com/lightdm-resolution/

In which I changed display-setup script to session-setup script. See sample file at /usr/share/doc/lightdm/lightdm.conf
jvdurme
Level 1
Level 1
 
Posts: 7
Joined: Thu Jan 05, 2012 6:09 pm


Return to MATE

Who is online

Users browsing this forum: No registered users and 4 guests