2020-05-27 02:31:42 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-09-25 17:25:56 +00:00
|
|
|
conectados=$(xrandr -q | awk '/ connected/ {count++} END {print count}')
|
2020-10-06 00:07:59 +00:00
|
|
|
pri=$(xrandr -q | awk '/ connected/ {print $1}' | sed -sn 1p)
|
2020-09-25 17:25:56 +00:00
|
|
|
sec=$(xrandr -q | awk '/ connected/ {print $1}' | sed -sn 2p)
|
2020-05-27 02:31:42 +00:00
|
|
|
|
2020-09-25 17:25:56 +00:00
|
|
|
if [ "$conectados" = 1 ]; then
|
2020-10-06 00:07:59 +00:00
|
|
|
xrandr --output "$pri" --primary --auto --scale 1.0x1.0 "$(xrandr -q | awk '/ disconnected/ {print "--output", $1, "--off"}' | paste -sd ' ')"
|
2020-09-25 17:25:56 +00:00
|
|
|
elif [ "$conectados" = 2 ]; then
|
2020-10-06 00:07:59 +00:00
|
|
|
xrandr --output "$pri" --primary --auto --scale 1.0x1.0 --output "$sec" --right-of "$pri" --auto --scale 1.0x1.0
|
2020-05-27 02:31:42 +00:00
|
|
|
fi
|