Update 2024-02-14 07:51 OpenBSD/amd64-x13
This commit is contained in:
26
.bin/OLD/dock
Executable file
26
.bin/OLD/dock
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
INTERNAL=LVDS-1
|
||||
|
||||
CONLIST=$(xrandr --query | grep " connected" | awk '{ print $1 }' | grep -v $INTERNAL)
|
||||
OFFLIST=$(xrandr --query | grep "disconnected" | awk '{ print $1 }')
|
||||
|
||||
if [ -z "$CONLIST" ]; then
|
||||
printf 'No external displays found, activating %s\n' "$INTERNAL"
|
||||
xrandr --output $INTERNAL --auto
|
||||
else
|
||||
printf 'External displays found, deactivating %s\n' "$INTERNAL"
|
||||
xrandr --output $INTERNAL --off --noprimary
|
||||
fi
|
||||
|
||||
for _dev in $OFFLIST;
|
||||
do
|
||||
printf 'Turning off disconnected output: %s\n' "$_dev"
|
||||
xrandr --output $_dev --off
|
||||
done
|
||||
|
||||
for _dev in $CONLIST;
|
||||
do
|
||||
printf 'Turning on connected output: %s\n' "$_dev"
|
||||
xrandr --output $_dev --auto --primary
|
||||
done
|
||||
Reference in New Issue
Block a user