For the sake of anyone else who’s fighting their screens, I’ve got a script that will do this (but very very slowly)
setup script
xrandr --output VGA1 --auto
xrandr --output LVDS1 --auto
xrandr --output VGA1 --rotate left
eval "`monconf`"
monoconf script
#!/usr/bin/env python
import subprocess
output = subprocess.check_output(["/home/tag/.bin/mon.ls"])
output = [ item.split() for item in output.split("\n") ]
mons = {}
for mon in output:
if len(mon) > 0:
if mon[1] == "connected":
res=mon[2]
res=res.split("x")
for item in res[1].split("+"):
res.append(item)
res.pop(1)
mons[mon[0]] = res
BOTTOM_LEFT = "LVDS1"
TOP_RIGHT="VGA1"
LEFT_WIDTH = mons[BOTTOM_LEFT][0]
LEFT_HEIGHT = mons[BOTTOM_LEFT][1]
RIGHT_WIDTH = mons[TOP_RIGHT][0]
RIGHT_HEIGHT = mons[TOP_RIGHT][1]
print "xrandr --output %s --pos 0x%s" % (
BOTTOM_LEFT,
(int(RIGHT_HEIGHT) - int(LEFT_HEIGHT)))
print "xrandr --output %s --pos %sx0" % (
TOP_RIGHT,
int(LEFT_WIDTH)
)
and the mon.ls command
xrandr -q | grep "^[^\ ].*" | grep -v Screen
All of this is super hacky, but it works.
Design by Simon Fletcher. Powered by Tumblr.
© Copyright 2010