add script to automatically turn on/off screens

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2014-09-09 10:57:21 +02:00
parent 1142bf67aa
commit eff86832c5

20
x-auto Executable file
View file

@ -0,0 +1,20 @@
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "$0 position"
exit 1
fi
primary=eDP1
# position: something xrandr understands
position=$1; shift
# Turn all off
for dp in $(xrandr | awk '/connected/ { print $1 }'); do
# Skip primary display
[ "$dp" = "$primary" ] && continue
xrandr --output "$dp" --auto --$position "$primary"
done