summary refs log tree commit diff
path: root/bin/vncez
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2021-01-21 19:33:10 +0100
committerRobert Günzler <r@gnzler.io>2021-01-21 19:40:20 +0100
commit72c39240811f1def43fca71de51566d206f7728d (patch)
treea33aa1331fc55b587a243f64ef94d781df40a8ae /bin/vncez
parent0762801ed9627021e732cdeb225a737f44e3df42 (diff)
Update 2021-01-21T18:33:10Z
Diffstat (limited to 'bin/vncez')
-rwxr-xr-xbin/vncez13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/vncez b/bin/vncez
index 068a199..f82f524 100755
--- a/bin/vncez
+++ b/bin/vncez
@@ -1,10 +1,11 @@
 #!/bin/sh
 set -e
+[ -n "$DEBUG" ] && set -x
 
 if [ -n "$1" ]; then
 	printf "usage: %s\n" "$(basename "$0")"
 	printf "\n"
-	printf "launches wayvnc(1), wshowkeys(1) and remmina(1)\n"
+	printf "launches a vnc server and client, creating a loopback X window\n"
 	exit 2
 fi
 
@@ -13,16 +14,18 @@ if [ -n "$OUTPUT" ]; then
 	server_args="-o ${OUTPUT}"
 fi
 
-trap '{ printf "\n=> killing everything...\n"; pkill wayvnc; pkill gvncviewer; }' EXIT
+
+trap '{ printf "\n=> killing everything...\n"; }' INT
+trap '{ killall -9 wayvnc gvncviewer; notify-send "stopped output mirror" "cleaned up viewer window and workspace"; }' EXIT
 
 # echo "=> starting wshowkeys"
 # swaymsg exec "wshowkeys -a bottom -a left -F 'Iosevka Sparkle 25' -t 1" >/dev/null
 echo "=> starting wayvnc"
-swaymsg exec "wayvnc -c dmabuf -r ${server_args} 0.0.0.0" >/dev/null
+swaymsg exec "wayvnc -r ${server_args} 0.0.0.0"
 echo "=> starting viewer"
-swx -b none -S -F '1.0 tl' -- x11fy gvncviewer localhost
+swx -w __vnc -- x11fy gvncviewer "0.0.0.0"
 
-notify-send 'started screensharing' 'the vnc viewer window was moved to the scratchpad'
+notify-send 'started output mirror' 'the vnc viewer X window was moved to new workspace\nyou can screen cast the desktop using it'
 while true; do
 	sleep $((1024*1024))
 done