Remove launch-x0vncserver and add setup-x0vncserver

main
Ian Mancini 4 years ago
parent 4a7d245628
commit 5ae03ca543

@ -1,36 +0,0 @@
#!/bin/sh
export DISPLAY=":0"
OUTPUT="DisplayPort-2"
ORIGINAL_RES=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/')
NEW_RES="${1:-$ORIGINAL_RES}"
WM=$(wmctrl -m | head -n 1 | cut -d " " -f2)
stop() {
if [ "$ORIGINAL_RES" != "$NEW_RES" ]; then
xrandr --output "$OUTPUT" --mode "$ORIGINAL_RES"
if [ "$WM" = "i3" ]; then
i3-msg restart
fi
fi
exit 0
}
trap stop INT
trap stop TERM
if [ "$ORIGINAL_RES" != "$NEW_RES" ]; then
xrandr --output "$OUTPUT" --mode "$NEW_RES"
if [ "$WM" = "i3" ]; then
i3-msg restart
fi
fi
x0vncserver -localhost -SecurityTypes none
while :
do
sleep 10
done

@ -0,0 +1,22 @@
#!/bin/bash
export DISPLAY=":0"
OUTPUT="DisplayPort-2"
ORIGINAL_RES=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/')
NEW_RES="${1:-$ORIGINAL_RES}"
WM=$(wmctrl -m | head -n 1 | cut -d " " -f2)
echo $ORIGINAL_RES
set_resolution() {
if [ "$ORIGINAL_RES" != "$NEW_RES" ]; then
xrandr --output "$OUTPUT" --mode "$1"
if [ "$WM" = "i3" ]; then
i3-msg restart
fi
fi
}
set_resolution $NEW_RES
Loading…
Cancel
Save