10 lines
323 B
Django/Jinja
10 lines
323 B
Django/Jinja
#!/bin/bash
|
|
source <(systemctl --user show-environment)
|
|
SECOND_DISPLAY="${DISPLAY%\.[0-9]*}.1"
|
|
if xrandr -d "$SECOND_DISPLAY" -q | grep -q "connected"; then
|
|
[ "$DISPLAY" != "$SECOND_DISPLAY" ] && d="DISPLAY=$SECOND_DISPLAY" || d="DISPLAY=$DISPLAY"
|
|
echo "$d" > ~/.second_display;
|
|
else
|
|
rm -f ~/.second_display
|
|
fi
|