vscripts/dmenu_displays

17 lines
607 B
Bash
Executable file

#!/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 "$@")
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 ;;
(*) exit 1 ;;
esac
/usr/bin/feh --bg-${WP_MODE-scale} $HOME/.wallpaper.png
/usr/bin/sleep 1
exit 0