rice/proj
shockrah 3cd83ed450 ignoring errors on playlist dl for ytdl
changed output ids to match new setup
2020-07-06 13:36:37 -07:00

33 lines
804 B
Bash
Executable File

#!/bin/sh
# Add or remove projectors
c=`printf 'Add\nRemove' | dmenu -i -p 'Add/Remove screens'`
if [ "$c" = "Add" ]
then
# Grab the display device
out=`xrandr | grep ' connected' | awk '{print $1}' | \
dmenu -i -p 'Device to attach'`
echo $out
if [ -z "$out" ]; then exit 0; fi
# what side should it go on
side=`printf 'left-of\nright-of\nabove\nbelow' | \
dmenu -i -p 'Pick side'`
if [ -z "$side" ]; then exit 0; fi
echo "xrandr --output $out --auto $side HDMI-4"
xrandr --output $out --auto --$side HDMI-4
else
# Get the display we want to remove
out=`xrandr | grep ' connected' | awk '{print $1}' | \
dmenu -i -p 'Device to dettach'`
if [ -z "$out" ]; then exit 0; fi
# Remove that device from xrandr
echo "xrandr --output $out --off"
xrandr --output $out --off
exit 0
fi