I run this command to allow me to move windows between screens:
xrandr --auto
This magic command fixes my screen for me (before I run this my 2nd monitor is just an empty space where I can move my mouse). How can I make whatever this command does stick when I reboot? I’m more interested in fixing my configuration than just re-running this command, but I’m clueless as to how to make this happen.
I have 2 monitors, DFP 5 and DFP 6. Running xrandr results in this:
DFP1 disconnected (normal left inverted right x axis y axis) DFP2 disconnected (normal left inverted right x axis y axis) DFP3 disconnected (normal left inverted right x axis y axis) DFP4 disconnected (normal left inverted right x axis y axis) DFP5 connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 474mm x 296mm 1680x1050 60.0*+ 1400x1050 60.0 1280x1024 75.0 60.0 1440x900 60.0 1280x960 75.0 60.0 1280x800 75.0 60.0 1152x864 60.0 75.0 1280x768 75.0 60.0 1280x720 75.0 60.0 1024x768 75.0 60.0 800x600 75.0 60.3 640x480 75.0 59.9 DFP6 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm 1680x1050 60.0*+ 1400x1050 60.0 1280x1024 75.0 60.0 1440x900 60.0 1280x960 75.0 60.0 1280x800 75.0 60.0 1152x864 60.0 75.0 1280x768 75.0 60.0 1280x720 75.0 60.0 1024x768 75.0 60.0 800x600 75.0 60.3 640x480 75.0 59.9 CRT1 disconnected (normal left inverted right x axis y axis)
I have already set up DFP 6 to be right of DFP 5 using the Displays menu in debian. Here is my xorg.conf file:
Section "ServerLayout"
Identifier "aticonfig Layout"
Screen 0 "aticonfig-Screen[0]-0" 0 0
EndSection
Section "Module"
EndSection
Section "Monitor"
Identifier "aticonfig-Monitor[0]-0"
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
EndSection
Section "Device"
Identifier "aticonfig-Device[0]-0"
Driver "fglrx"
BusID "PCI:4:0:0"
EndSection
Section "Screen"
Identifier "aticonfig-Screen[0]-0"
Device "aticonfig-Device[0]-0"
Monitor "aticonfig-Monitor[0]-0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
virtual 3360 1050
EndSubSection
EndSection
It seems to be configured for everything to be one screen, and xrandr --auto somehow fixes it. Is there some way of taking a peek at what this command is doing to save the result to xorg.conf? How do you normally use xrandr to get the results to persist?
If I search for this I either get told to modify my xorg.conf file (which I don’t know how to do because I don’t know what xrandr --auto is actually doing) or instructions on how to run xrandr on startup, which I’m guessing isn’t necessary, but I may be wrong.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
I created the following file:
/etc/X11/Xsession.d/45custom_xrandr-settings and placed this line into it:
xrandr --output DFP6 --primary
This had the effect of making the correct monitor the primary one, and it launches on login.
Method 2
Since this is the fglrx driver, you can use the aticonfig command to generate an xorg.conf file. From your xrandr output I’m guessing the command you need is this:
sudo aticonfig --initial=dual-head --screen-layout=left
If this doesn’t give you what you want, aticonfig will automatically back up your xorg.conf file (with a .fglrx-x extension), so you can easily restore the original configuration.
If you don’t have any luck with aticonfig, there is a GUI tool configuring xorg.conf called amdcccle (should be in the fglrx-control package).
Method 3
Run it with a boot script.
Part 1:
Create a directory for scripts… this can be anything and anywhere, just remember the location if you deviate so you can substitute it in.
mkdir ~/Scripts
You can use any text editor you are comfortable using for the next part
gedit ~/Scripts/setoutput.sh
Add these to the script
#!/usr/bin/env sh
xrandr –auto
I use “xrandr -s 1440×900”
Save/close the file.
Finish up by running the following commands:
chmod +x ~/Scripts/setoutput.sh sudo ln -s ~/Scripts/setoutput.sh /etc/X11/Xsession.d/45setoutput reboot
“reboot” may need replaced with “shutdown -r now”
When the system boots, your settings should have run, making them now persistent as long as the script exists.
Thanks in part to “xenopeek” for their post on Tue Nov 01, 2011 7:02 am at Linuxmint which provided directions for doing this with “xrandr –output VGA-0 –primary”. Same base concept/script even if the command changed slightly.
Method 4
How to make xrandr setting presistent
If you don’t see your desired resolution in gnome settings:
Do these but change 1600 and 900 as you wish:
cvt 1600 900
command output:
# 1600x900 59.95 Hz (CVT 1.44M9) hsync: 55.99 kHz; pclk: 118.25 MHz Modeline "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
xrandr --newmode [output of line 1 after the word modeline]
command:
xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
xrandr --addmode 1600x900_60.00sudo gedit /etc/X11/Xsession.d/45custom_xrandr-settings- Add step 2 and 3 commands in file of step 4 and save
- Reboot and test.
As @quant said it loads after log in. And worked for me too. But different scenario. Thanks @quant.
Hardware:
- Display monitor: HP EliteDisplay E201
- Graphic: Xeon E3-1200 (CPU Based no graphic card)
Method 5
cvt 2560 1080 600 # copy output, minus 'Modeline' xrandr --newmode "2560x1080_60.00" 230.00 2560 2720 2992 3424 1080 1083 1093 1120 -hsync +vsync xrandr --addmode HDMI1 "2560x1080_60.00" xrandr --output HDMI1 --mode 2560x1080_60.00 --rate 50.0 xrandr --output eDP1 --mode 1920x1080 --rate 60.0
check xrandr to see your HDMI number and eDP1 (which is my internal screen laptop)
add these lines to sudo gedit /usr/sbin/lightdm-session
#Guide #Purge xorg, xserver-* nvidia* #Install online xorg and xserver-xorg #Install nvidia-settings and nvidia-prime #gnome-session-properties #unity --replace
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0