diff options
author | tdro <tdro@users.noreply.github.com> | 2022-01-17 01:22:16 -0500 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2022-01-17 01:22:16 -0500 |
commit | 9481c61f3742562651d13269fb71fc67ad5e7c0f (patch) | |
tree | d177ae82458ed70343cfdd70c9a39e8e02588e6a | |
parent | ee389d6b4e680d1b67497cea585009124037c5c7 (diff) | |
download | dotfiles-9481c61f3742562651d13269fb71fc67ad5e7c0f.tar.gz dotfiles-9481c61f3742562651d13269fb71fc67ad5e7c0f.tar.bz2 dotfiles-9481c61f3742562651d13269fb71fc67ad5e7c0f.zip |
.local/bin/vnc: Add old VNC script
-rwxr-xr-x | .local/bin/vnc | 30 |
1 files changed, 30 insertions, 0 deletions
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"; |