From fc085da8db6746e272ff9ca428f20505ff7e115d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 14 Mar 2023 11:19:59 +0100 Subject: Rework wayvnc --- local/bin/sshvnc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'local/bin/sshvnc') 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" -- cgit v1.2.3