dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

displayselect (415B)


      1 #!/bin/sh
      2 set -e
      3 
      4 ext_screens="$(xrandr -q | awk '/ connected/ {if (i>0) {print $1}; i++}')"
      5 
      6 if [ -z "$ext_screens" ]; then
      7 	mon int
      8 else
      9 	if [ "$(printf '%s' "$ext_screens" | wc -w)" -eq 1 ]; then
     10 		ext="${ext_screens}"
     11 	else
     12 		ext="$(printf '%s' "$ext_screens" | dmenu -i -p "external:")"
     13 	fi
     14 	mode="$(printf 'ext\next-native\ndual\nmirror\nmirror-native' | dmenu -i -p "$ext mode:")"
     15 	EXT="$ext" mon "$mode"
     16 fi