You are not logged in.

#1 2011-08-24 18:06:15

roygbiv
Member
Registered: 2011-05-18
Posts: 204

How do you connect your external monitor(s)?

More frequently I'm using an external monitor when working on Arch Linux, so I made this script, which works ok for now. This is a simple approach for this kind of stuff I think, so I'm wondering what you people out there are using to connect your external monitors. I guess there's a bunch of people in this community that are using two (or more) monitors? Please post your beloved script or name the package you are using. I would also be happy with some feedback or tips on my script.

#!/bin/bash
#~/scripts/vga

case $1 in
-r|--right) xrandr --output VGA1 --auto --right-of LVDS1 ;;
-l|--left)  xrandr --output VGA1 --auto --left-of LVDS1 ;;
-o|--off)   xrandr --output VGA1 --off ;;
*)          xrandr --output VGA1 --auto ;;
esac

Last edited by roygbiv (2011-08-24 18:15:54)

Offline

#2 2011-08-24 19:34:22

SS4
Member
From: !Rochford, Essex
Registered: 2010-12-05
Posts: 699

Re: How do you connect your external monitor(s)?

#!/bin/bash
#
# A script to set up monitors correctly
# by SS4
#
xrandr --output DVI-I-1 --auto --left-of VGA-1 --output VGA-1 --auto --primary

Both my monitors are usually connected on boot although it does work if I hotplug the second monitor in


Rauchen verboten

Offline

#3 2011-08-24 19:45:18

KlavKalashj
Member
Registered: 2008-10-09
Posts: 376

Re: How do you connect your external monitor(s)?

When I'm at home I connect my laptop to my TV and use that as the only screen. I have mapped the screen fn-key to this script:

#!/bin/bash
if xrandr -q | grep "HDMI1 connected" > /dev/null ; then
#       xrandr --newmode "1920x1080" 138.500 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync
#       xrandr --addmode HDMI1 1920x1080
        xrandr --output HDMI1 --mode 1360x768
        xrandr --output LVDS1 --off
else
        xrandr --output LVDS1 --mode 1366x768
        xrandr --output HDMI1 --off
fi

Works perfectly.

Offline

#4 2011-08-25 06:47:12

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: How do you connect your external monitor(s)?

I run this script on login/when I click the VGA button.

#!/bin/bash
mode="$(xrandr -q|grep -A1 "VGA1 connected"| tail -1 |awk '{ print $1 }')"
if [ -n "$mode" ]; then
    xrandr --output VGA1 --mode "$mode" --right-of LVDS1
    xrandr --output LVDS1 --primary
else
    xrandr --output VGA1 --off
fi

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#5 2011-08-25 07:55:32

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: How do you connect your external monitor(s)?

autorandr (I maintain it on the AUR).


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#6 2011-08-25 08:54:18

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: How do you connect your external monitor(s)?

I use this in my .xinitrc on all my machines:

# If two monitors are present, setup tiling.
if [[ -x /usr/bin/xrandr ]]; then
    OUTPUTS=($( xrandr | grep connected | cut -f 1 -d ' '))
    if [[ ${#OUTPUTS[@]} == 2 ]]; then
        xrandr --output ${OUTPUTS[0]} --left-of ${OUTPUTS[1]}
    fi
fi

Offline

#7 2011-08-25 09:47:52

davvil
Member
Registered: 2008-05-06
Posts: 165

Re: How do you connect your external monitor(s)?

I made a small program for this while learning haskell. You can find it here.

Offline

Board footer

Powered by FluxBB