12 lines
540 B
Bash
Executable File
12 lines
540 B
Bash
Executable File
#!/bin/sh
|
|
|
|
conectados=$(xrandr -q | awk '/ connected/ {count++} END {print count}')
|
|
pri=$(xrandr -q | awk '/ connected/ {print $1}' | sed -sn 1p)
|
|
sec=$(xrandr -q | awk '/ connected/ {print $1}' | sed -sn 2p)
|
|
|
|
if [ "$conectados" = 1 ]; then
|
|
xrandr --output "$pri" --primary --auto --scale 1.0x1.0 "$(xrandr -q | awk '/ disconnected/ {print "--output", $1, "--off"}' | paste -sd ' ')"
|
|
elif [ "$conectados" = 2 ]; then
|
|
xrandr --output "$pri" --primary --auto --scale 1.0x1.0 --output "$sec" --right-of "$pri" --auto --scale 1.0x1.0
|
|
fi
|