Fish Posted September 19, 2008 Share Posted September 19, 2008 I've been playing with getting a dual screen setup working using the Intel driver and xrandr. Previously I was doing this with the old i810 driver and some xorg tweaks, but xrandr seems a lot neater, and the i810 driver has been depricated in favour of the intel one. Anyway, I can "trigger" a dual display from a terminal with xrandr --output LVDS --mode 1024x768 --output VGA --mode 1024x768 --right-of LVDS but of course ideally I'd like to run this line automatically whenever somebody logs in. I have read that it's possible to include some of this in xorg.conf, but I've tried without success. As X loaded it was spread across both screens, but then GDM appeared on my right screen only, and when I logged in I was back to a mirrored display. It seems to me, though, that if one simple command is all that's needed then surely I can leave xorg.conf alone and just "somehow" execute it. "Somehow" is the question I'm asking :D Link to comment Share on other sites More sharing options...
rson451 Posted September 19, 2008 Share Posted September 19, 2008 Depending on how you start x, you could possibly put this in your ~/.xinitrc (if you use startx or xinit for example). If x is started automatically at boot, I'm not sure. Link to comment Share on other sites More sharing options...
Fish Posted September 19, 2008 Author Share Posted September 19, 2008 Yes, this is Ubuntu and X starts automatically. I have no .xinitrc file. Link to comment Share on other sites More sharing options...
Elv13 Posted September 20, 2008 Share Posted September 20, 2008 create it! or put it in autostart thing in gnome (system;settings;Auto start) or something like that. You can also put in GDM config if you want. Link to comment Share on other sites More sharing options...
Fish Posted September 20, 2008 Author Share Posted September 20, 2008 Elv13 - thanks! Gnome-sessions was the key to this. I put the command into a text file and saved it as /usr/bin/xrandr.sh, and made it executable. I then simply added xrandr.sh to the entries in "sessions". Such a simple solution in the end... For those interested, here's the file #!/bin/bash xrandr --output LVDS --mode 1024x768 --output VGA --mode 1024x768 --right-of LVDS gconftool --type int --set /apps/panel/toplevels/top_panel_screen0/monitor 1 gconftool --type int --set /apps/panel/toplevels/bottom_panel_screen0/monitor 1 The two gconftool entries are necessary because Gnome always calls the external monitor "screen0" which causes all the panels to be drawn on the secondary screen. These two entries force them to appear on my laptop screen. Link to comment Share on other sites More sharing options...
Recommended Posts