Improve switching primary and secondary display
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user