aboutsummaryrefslogtreecommitdiff
path: root/local
diff options
context:
space:
mode:
Diffstat (limited to 'local')
-rwxr-xr-xlocal/bin/sshvnc12
-rwxr-xr-xlocal/sbin/wayvnc13
2 files changed, 9 insertions, 6 deletions
diff --git a/local/bin/sshvnc b/local/bin/sshvnc
index fcee459..427a785 100755
--- a/local/bin/sshvnc
+++ b/local/bin/sshvnc
@@ -1,17 +1,17 @@
#!/usr/bin/env bash
-set -eu
+set -eux
target="$1"
-localport="5901"
+localport="5911"
while lsof -i:$localport; do
localport=$((localport + 1))
done
-ssh -L "$localport":localhost:5900 "$target" \
- 'start-stop-daemon -v -w 1000 -bmp "/var/run/user/$(id -u)/sshvnc.pid" -e WAYLAND_DISPLAY=wayland-1 -S wayvnc localhost 5900'
+ssh -L "$localport":localhost:5901 "$target" \
+ 'systemctl --user start wayvnc1.service'
vncviewer "localhost:$localport"
-ssh "$target" 'start-stop-daemon -v -p /var/run/user/$(id -u)/sshvnc.pid -K wayvnc'
-ssh -O cancel -L "$localport":localhost:5900 "$target"
+ssh "$target" 'systemctl --user stop wayvnc1.service'
+ssh -O cancel -L "$localport":localhost:5901 "$target"
diff --git a/local/sbin/wayvnc1 b/local/sbin/wayvnc1
new file mode 100755
index 0000000..b21479d
--- /dev/null
+++ b/local/sbin/wayvnc1
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+export WAYLAND_DISPLAY=wayland-1
+exec wayvnc localhost 5901