How to setup multiple monitors on Xfce desktop?
How to setup multiple monitors on Xfce desktop?
I just followed the instructionson Xorg RandR 1.2 wiki
http://www.thinkwiki.org/wiki/Xorg_RandR_1.2
Lets find out how many monitors we have connected?
$ xrandr -q Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192 LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm 1280x800 60.0*+ 50.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 connected (normal left inverted right x axis y axis) 1680x1050 60.0 + 1280x1024 75.0 60.0 1152x864 75.0 1024x768 75.1 60.0 800x600 75.0 60.3 640x480 75.0 60.0 720x400 70.1 HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI2 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) DP3 disconnected (normal left inverted right x axis y axis)
Now ask Xrandr to configure them:
$ xrandr --output LVDS1 --auto --output VGA1 --auto --right-of LVDS1
Now thats simply cool!
Siddhesh 2:25 pm on November 17, 2011 Permalink |
Here’s a script I’ve written to do this with any external display (monitor, projector, etc.). Execute it after connecting the display to your box:
#!/bin/sh
typeset -a resx
typeset -a resy
typeset -a screen
typeset -i name=1
typeset -i count=0
tmpfile=$(mktemp)
cmd=”xrandr –fb ”
xrandr | grep -A 1 ” connected ” | grep -v “^–$” | awk ‘{print $1}’ > $tmpfile
count=0
for line in $(cat $tmpfile); do
if [ $name -eq 1 ]; then
screen[$count]=$line
name=0
else
line=$(echo $line|sed ‘s/[Xx]/ /g’)
resx[$count]=$(echo $line | awk ‘{print $1}’)
resy[$count]=$(echo $line | awk ‘{print $2}’)
count=$((count+1))
name=1
fi
done
total_width=0
prev_scr=
max_height=0
for i in $(seq 0 $((count-1))); do
if [ $max_height -lt ${resy[$i]} ]; then
max_height=${resy[$i]}
fi
cmd_ext=”$cmd_ext –output ${screen[$i]} –mode ${resx[$i]}x${resy[$i]}”
if [ -n "$prev_scr" ]; then
cmd_ext=”$cmd_ext –right-of $prev_scr”
fi
prev_scr=${screen[$i]}
total_width=$((total_width+${resx[$i]}))
done
cmd=”xrandr –fb ${total_width}x${max_height} $cmd_ext”
echo “Running command: $cmd”
eval $cmd
rm -f tmpfile
tuxdna 2:36 pm on November 17, 2011 Permalink |
Thanks for sharing. I have created a gist for the same:
https://gist.github.com/1373278