From 859e859785ae8503242b3aa2909cfb579935a27c Mon Sep 17 00:00:00 2001 From: Gardouille Date: Thu, 25 Sep 2014 23:37:13 +0200 Subject: [PATCH] Add script to manage xrandr --- ecran | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 ecran diff --git a/ecran b/ecran new file mode 100755 index 0000000..5ad2356 --- /dev/null +++ b/ecran @@ -0,0 +1,32 @@ +#! /bin/sh + +# Description: Manage video output (size, orientation, ...) +# And reload wm configuration +# +# $1: a directory with images to convert or a image file path + + +case "${1}" in + ds | dockstation | work ) + xrandr --output HDMI1 --mode 1680x1050 --above LVDS1 --output LVDS1 --mode 1366x768 + printf 'Xrandr for DisplayPort with dock station';; + vga | lug ) + xrandr --output VGA1 --mode 1280x1024 --right-of LVDS1 --output LVDS1 --mode 1366x768 + printf 'Xrandr for dual screen with VGA';; + hdmi | dp | displayport ) + xrandr --output HDMI1 --mode 1920x1080 --above LVDS1 --output LVDS1 --mode 1366x768 + printf 'Xrandr for dual screen with DisplayPort';; + - | off ) + xrandr --output LVDS1 --mode 1360x768 --output HDMI1 --off --output VGA1 --off + xrandr --output VGA --off + printf 'Desactivate all video output';; + * ) + printf 'Bad argument, please use [vga|hdmi|ds|work|-|off]' + exit 1;; + +esac + +herbstclient detect_monitors +herbstclient reload + +exit 0