vscripts/dmenu_displays

18 lines
607 B
Text
Raw Normal View History

2017-06-13 17:52:17 +03:00
#!/usr/bin/env zsh
if [[ -r $HOME/.displayrc ]]; then
. $HOME/.displayrc
else
exit 1
fi
selection=$(printf "%s\n" $VARIANTS|/usr/bin/dmenu -p display "$@")
2017-06-13 17:52:17 +03:00
case $selection in
($VARIANTS[1]) /usr/bin/xrandr --output $DISPLAY_RIGHT --off --output $DISPLAY_LEFT --auto ;;
($VARIANTS[2]) /usr/bin/xrandr --output $DISPLAY_LEFT --off --output $DISPLAY_RIGHT --auto ;;
($VARIANTS[3]) /usr/bin/xrandr --output $DISPLAY_LEFT --auto --output $DISPLAY_RIGHT --auto --right-of $DISPLAY_LEFT ;;
2017-06-14 19:12:54 +03:00
(*) exit 1 ;;
2017-06-13 17:52:17 +03:00
esac
/usr/bin/feh --bg-${WP_MODE-scale} $HOME/.wallpaper.png
2017-06-14 19:12:54 +03:00
/usr/bin/sleep 1
2017-06-13 17:52:17 +03:00
exit 0