From 8ac263a880bc0b5ab5c108ef4a47e37b0338ef25 Mon Sep 17 00:00:00 2001 From: Von Random Date: Tue, 13 Jun 2017 18:03:08 +0300 Subject: [PATCH] less hardware tied variant, uses .displayrc config --- dmenu_laptop_screens | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dmenu_laptop_screens b/dmenu_laptop_screens index e441c39..87afbf9 100755 --- a/dmenu_laptop_screens +++ b/dmenu_laptop_screens @@ -1,12 +1,18 @@ #!/usr/bin/env zsh +if [[ -r $HOME/.displayrc ]]; then + . $HOME/.displayrc +else + exit 1 +fi + variants=(int ext both) selection=$(printf "%s\n" $variants|dmenu -p display "$@") case $selection in - ('int') xrandr --output HDMI1 --off --output eDP1 --auto ;; - ('ext') xrandr --output eDP1 --off --output HDMI1 --auto ;; - ('both') xrandr --output eDP1 --auto --output HDMI1 --auto --right-of eDP1 ;; + ($variants[1]) xrandr --output $DISPLAY2 --off --output $DISPLAY1 --auto ;; + ($variants[2]) xrandr --output $DISPLAY1 --off --output $DISPLAY2 --auto ;; + ($variants[3]) xrandr --output $DISPLAY1 --auto --output $DISPLAY2 --auto --right-of eDP1 ;; (*) exit 0 ;; esac -feh --bg-scale ${HOME}/.wallpaper.png +feh --bg-scale $HOME/.wallpaper.png sleep 1 exit 0