You are not logged in.

#1 2009-02-25 20:22:01

danrg7
Member
Registered: 2008-02-09
Posts: 6

External Monitor and LXDE

I run Arch + LXDE on my laptop and everything works great. Recently, I attempted to attach my laptop to an external monitor and use lxrandr to output only to the external. When I first tried it, the output worked fine but I was unable to adjust the resolution on the external monitor to anything greater than the best resolution I can get with my laptop. After restarting X, though, I was able to get max possible resolution on the external. However, this does not happen automatically, and every time I attach the monitor I have to reset the resolution to the best possible. Also, PCManFM only displays the desktop on a portion of my monitor equivalent to the laptop resolution (1280x800) even though the laptop monitor is disabled by lxrandr. The rest of the desktop is just openbox; when I right click on it, I get the openbox menu. Furthermore, when I attempt to switch to an agetty, the display is not aligned and most of the left side of the output is cut off. However, if I open the laptop, the agetty output works nicely there.

The agetty problem doesn't surprise me because that has nothing to do with Xorg, but it would be really nice if everything just worked. I have tried looking for similar problems (and solutions), but I can find very little information. I would like to have PCManFM put the desktop on the whole display, I would like to have the best resolution automatically when I plug in the external, and (maybe) I would like to be able to use the agetty terminals when I just want to work from the terminal.

Thanks!

Offline

#2 2009-02-25 21:42:29

OpenBSD
Member
Registered: 2009-02-04
Posts: 43

Re: External Monitor and LXDE

I use auto xorg (no xorg.conf), so I use this in xinitrc:

[snip]
xrandr --output LVDS --auto
xrandr --output VGA --auto --right-of LVDS
[snip]

No nothing about lxrandr, is it a gui for xrandr?
Or does is just mirror your screen to external?

Last edited by OpenBSD (2009-02-25 21:47:24)

Offline

#3 2009-02-26 03:24:10

big_gie
Member
Registered: 2005-01-19
Posts: 637

Re: External Monitor and LXDE

lxrandr is a small gui for controlling xrandr. Its quite nice at what it does. You can enable one or the other, or clone (you can't have both with "right/left/... of")

Maybe it is something with the maximum screen size? Is it a big display? I have a 22' monitor and I had to add "Virtual 3600 2250" to my xorg.conf. Else the resolution was not enough... Look here http://intellinuxgraphics.org/dualhead.html for where to put the virtual thing (its the only line you need, forget the rest...)

Offline

#4 2009-02-26 08:07:37

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: External Monitor and LXDE

You could give arandr a try, maybe that one works better for you. I'm on LXDE as well, but haven't used LXrandr before, only arandr on Xfce and it worked really great

Offline

#5 2009-02-27 19:53:59

danrg7
Member
Registered: 2008-02-09
Posts: 6

Re: External Monitor and LXDE

I want to avoid setting up a xorg.conf file, and arandr works pretty much the same way as lxrandr. So I decided to write a simple script that I could run at startup to automatically set the resolution of all attached monitors to the maximum possible. Here is the script, and I can run it from /etc/xdg/lxsession/LXDE/autostart:

#!/bin/bash

query=`xrandr -q 2>/dev/null`
screens=`echo "${query}" | grep '^[A-Za-z].*' | sed -e '/^Screen.*/d' -e 's/[ \t].*$//g'`

c=0
for s in $screens; do
    screenarr[$c]=$s
    c=$(($c+1))
done

displaylines=`echo "${query}" | grep -n '^[A-Za-z].*' | sed -e '/^[0-9]:Screen.*/d' -e 's/:.*//g'`

c=0
for i in $displaylines; do
    resline=$(($i+1))
    res=`echo "${query}" | grep -n '.*' | sed -e "/^$resline:[ \t].*[0-9]/!d" -e 's/^[0-9].*: *//' -e 's/ .*//'`
    if [ "$res" != "" ]; then
        xrandr --output ${screenarr[$c]} --mode ${res} 2>/dev/null
    fi
    c=$(($c+1))
done

I wrote this really quickly so if anyone has an suggestions for improvement that would be great. I am hoping to generalize this so that you can pass it simple parameters to have some control as to how your monitors are configured. Also, if you have a better way to extract the monitor information than from xrandr -q and regex that would be a huge improvement.

When run from autostart before PCManFM, PCManFM fills the full screen with the desktop.

Offline

Board footer

Powered by FluxBB