Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
howtos:window_managers:dual_monitors [2016/01/04 07:50 (UTC)]
arfon created (saving to NOT lose my work so far)
howtos:window_managers:dual_monitors [2016/02/03 23:03 (UTC)] (current)
arfon Changed title - no change in info.
Line 1: Line 1:
 <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). -->
-====== ​DUAL MONITORS ​======+====== ​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 ====== ====== Mirror Monitors ======
Line 8: Line 16:
  
 ====== Extend Desktop To Second Monitor ====== ====== 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 ​\\ +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. 
- Make sure your video card's output is being '​seen'​ by the system and get the output names:+ 
 +1) Make sure your video card's output is being '​seen'​ by the system and get the output names:
 <​code>​ xrandr -q </​code>​ <​code>​ xrandr -q </​code>​
-Make note of the name of your secondary monitor.+ ​( ​Make note of the name of your secondary monitor. ​)
  
-Move the secondary monitor over to the right+2) Move the secondary monitor over to the right
 <​code>​ xrandr --output HDMI-0 --pos 1024x0 # to move the VGA screen 1024 pixels to the right. </​code>​ <​code>​ xrandr --output HDMI-0 --pos 1024x0 # to move the VGA screen 1024 pixels to the right. </​code>​
  
-EXAMPLE: Here's my machine. DVI-I-is my LEFT monitor and HDMI-0 is my RIGHT monitor.+EXAMPLE: Here's my machine. DVI-I-is my LEFT monitor and HDMI-0 is my RIGHT monitor.
 <​code>​ <​code>​
 [arfon@darkstar ~]$ xrandr -q [arfon@darkstar ~]$ xrandr -q
Line 47: Line 56:
  
  
 +====== Cool Switching Scripts ======
 +Here's a script I wrote to toggle between extended dual monitors and a single monitor-
 +<​code>​
 +#!/bin/bash
 +vPRIMARYMONITOR="​DVI-I-0"​ # <--- 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
 +
 +</​code>​
 +
 +Script to toggle a mirrored monitor-
 +<​code>​
 +#!/bin/bash
 +vPRIMARYMONITOR="​DVI-I-0"​ # <--- 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
 +</​code>​
  
  

In Other Languages
QR Code
QR Code howtos:window_managers:dual_monitors (generated for current page)