You are viewing tirdc

 
 
04 June 2010 @ 08:38 am
gdm multihead xrandr workaround  
This is totally unrelated to Radeon development, but I couldn't find a good guide for that.

I'm using a Laptop with an external TFT attached to it for my work. It works great using gnome-display-properties to setup the displays when I'm logged in. But it really lacks a "Apply for all users" setting. So it always bothered me that gdm was using mirror mode (or clone mode) for the login. That looks really awful. And since I'm not a big fan of hard coding display settings in my xorg.conf(.d) (and the external display is not connected all the time as this is a laptop) I came up with the following solution:

1.) Open /etc/gdm/Init/Default in your favorite editor

2.) Put the following code right before "/sbin/initctl -q emit login-session-start DISPLAY_MANAGER=gdm"


VGA1_PRESENT=`xrandr | grep "VGA1 connected"`
if [ "x${VGA1_PRESENT}x" != "xx" ]; then
xrandr --output LVDS1 --auto --pos 0x0 --primary
xrandr --output VGA1 --auto --right-of LVDS1
fi


3.) Restart X.org

There might be better solutions to this but I could not find any. I hope it helps other that face the same issue.
 
 
 
( 2 comments — Leave a comment )
(Anonymous) on August 5th, 2011 07:31 pm (UTC)
My Hero
I have been trying to figure out how to see ANYTHING on my external monitors (pre login).
I had a script that i ran after logging in, but I had to login blind.
Stumbled on your post ( From a comment at https://bbs.archlinux.org/viewtopic.php?id=98437)

Had to tweak it a little :
EXT_PRESENT=`xrandr | grep "DVI1 connected"`
if [ "x${EXT_PRESENT}x" != "xx" ]; then
xrandr --output DVI1 --auto --pos 0x0 --primary
xrandr --output LVDS1 --off
xrandr --output VGA1 --auto --right-of DVI1
fi


I had tried creating an executable script (/bin/set-display)
#!/bin/bash
num=`xrandr|grep -c DVI1\ connected`
if [ "$num" = "1" ]
then
`xrandr -s 3840x1080 --output DVI1 --auto --primary --left-of VGA1 --output VGA1 --auto --output LVDS1 --off`
fi

then before "/sbin/initctl........" added
`/bin/set-display`

but it wasn't working
Don't know why I didn't try coding right in "Default"?
Thanks again

tirdctirdc on August 5th, 2011 07:55 pm (UTC)
Re: My Hero
I'm glad this helped you. It also took me quite some time to get the right idea, too.
( 2 comments — Leave a comment )