This is an old revision of the document!
Table of Contents
DUAL MONITORS
Known to work on Slackware 14.1 and XFCE
If you are running XFCE and your secondary monitor isn't working, check and make sure it's enabled in XFCE's SETTINGS:
SETTINGS > SETTING MANAGER > DISPLAY > display name in column on left > USE THIS OUTPUT
Mirror Monitors
By default, XFCE (the WM I use) seems to do this by default.
Extend Desktop To Second Monitor
To extend the desktop to a second monitor (as opposed to mirror the desktop), you need to use xrandr to move the desk top over X number of pixels. Where X = your LEFT monitor's X resolution.
1) Make sure your video card's output is being 'seen' by the system and get the output names:
xrandr -q
( Make note of the name of your secondary monitor. )
2) Move the secondary monitor over to the right
xrandr --output HDMI-0 --pos 1024x0 # to move the VGA screen 1024 pixels to the right.
EXAMPLE: Here's my machine. DVI-I-2 is my LEFT monitor and HDMI-0 is my RIGHT monitor.
[arfon@darkstar ~]$ xrandr -q Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384 DVI-I-0 disconnected (normal left inverted right x axis y axis) DVI-I-1 disconnected (normal left inverted right x axis y axis) DVI-I-2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm 1920x1080 60.0*+ 1680x1050 60.0 1440x900 59.9 1280x1024 75.0 60.0 1280x960 60.0 1280x800 59.8 1280x720 60.0 1152x864 75.0 1024x768 75.0 70.1 60.0 800x600 75.0 72.2 60.3 56.2 640x480 75.0 72.8 59.9 HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 521mm x 293mm 1920x1080 60.0*+ 59.9 60.1 60.0 1440x480 60.1 1280x720 60.0 59.9 1024x768 75.0 70.1 60.0 800x600 75.0 60.3 720x480 59.9 60.1 640x480 75.0 59.9 59.9 DVI-I-3 disconnected (normal left inverted right x axis y axis) [arfon@darkstar ~]$ xrandr --output HDMI-0 --pos 1920x0
Cool Switching Scripts
Here's a script I wrote to toggle between extended dual monitors and a single monitor-
#!/bin/bash vPRIMARYMONITOR="DVI-I-3" # <--- CHANGE THIS. Find using "xrandr -q" vLOC="--right" # <--- Change this if you want the second monitor in another position. CHOICES: --above --below --left --right vEXT=$(xrandr -q | grep " connected" | grep -v $vPRIMARYMONITOR | awk '{print $1}' | head -n 1 ) vOnOff=$(xrandr -q | grep $vEXT | sed 's/primary//g' | awk '{print $3}'| sed 's/[0-9]*x[0-9]*+[0-9]*+[0-9]*/ON/g' ) [ "$vOnOff" != "ON" ] && vOnOff="OFF" if [ "$vOnOff" = "OFF" ]; then /usr/bin/xrandr --output $vEXT --auto $vLOC $vPRIMARYMONITOR else /usr/bin/xrandr --output $vEXT --off fi
Script to toggle a mirrored monitor-
#!/bin/bash vPRIMARYMONITOR="DVI-I-3" # <--- CHANGE THIS. Find using "xrandr -q" vEXT=$(xrandr -q | grep " connected" | grep -v $vPRIMARYMONITOR | awk '{print $1}' | head -n 1 ) vOnOff=$(xrandr -q | grep $vEXT | sed 's/primary//g' | awk '{print $3}'| sed 's/[0-9]*x[0-9]*+[0-9]*+[0-9]*/ON/g' ) [ "$vOnOff" != "ON" ] && vOnOff="OFF" if [ "$vOnOff" = "OFF" ]; then /usr/bin/xrandr --output $vEXT --auto else /usr/bin/xrandr --output $vEXT --off fi