1 2 3 4 5 6 7 8 9 10
#!/sbin/sh XSTATS="$(xrandr)" PRIMARY="$(echo "$XSTATS" | grep "primary" | awk '{print $1}')" OUTPUT="$(echo "$XSTATS" | grep '[0-9]*x[0-9]*+[0-9]*+[0-9]' | grep -v 'primary' | awk '{print $1}' | tofi --height 24 --prompt 'Which output?')" [ -z "$OUTPUT" ] && exit 2 xrandr --output "$OUTPUT" --off