Usage:
setmonitor <left|right|off>
change the variable values in the beginning of the script according to your monitor setup.
xrandr shows you available monitors and modes.
#! /bin/bash
vga=VGA1
lvds=LVDS1
vgamode=1280x1024
lvdsmode=1680x1050
action=$1
test -n "$action" || exit 1
if [ $action == 'left' ]; then
xrandr --output $vga --mode $vgamode
xrandr --output $lvds --mode $lvdsmode
xrandr --output $vga --left-of $lvds
xrandr --output $vga --auto
elif [ $action == 'right' ]; then
xrandr --output $vga --mode $vgamode
xrandr --output $lvds --mode $lvdsmode
xrandr --output $vga --right-of $lvds
xrandr --output $vga --auto
elif [ $action == 'off' ]; then
xrandr --output $vga --off
else
echo "action $action unknown. Use left | right | off."
fi
No comments:
Post a Comment