From 9481c61f3742562651d13269fb71fc67ad5e7c0f Mon Sep 17 00:00:00 2001 From: tdro Date: Mon, 17 Jan 2022 01:22:16 -0500 Subject: .local/bin/vnc: Add old VNC script --- .local/bin/vnc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 .local/bin/vnc diff --git a/.local/bin/vnc b/.local/bin/vnc new file mode 100755 index 0000000..093a292 --- /dev/null +++ b/.local/bin/vnc @@ -0,0 +1,30 @@ +#!/bin/sh -eu + +host="$1" +address="$host.local" + +. "$HOME/.vnc/keys/macs" + +[ "$host" = 'hound' ] && wol "$hound"; +[ "$host" = 'tiger' ] && wol "$tiger"; + +notify-send -t 2000 Connecting...; + +i=0; +until ping -c1 "$address" > /dev/null 2>&1; +do notify-send -t 2000 'Waiting for response...'; + i=$((i+1)); [ "$i" -gt 5 ] && notify-send -u critical 'Unable to negotiate connection.' && exit; +done; + +notify-send -t 4000 Connected.; + +vncviewer -passwd "$HOME/.vnc/keys/passwd-$host" \ + AlertOnFatalError=0 \ + AutoSelect=0 \ + CompressLevel=0 \ + DotWhenNoCursor=1 \ + Fullscreen=1 \ + PreferredEncoding=Hextile \ + QualityLevel=6 \ + Shared=1 \ + "$address"; -- cgit v1.2.3