Skip to content

Instantly share code, notes, and snippets.

@vilmibm
Last active February 27, 2018 17:36
Show Gist options
  • Save vilmibm/13d935e5617486c9dba3b9ecbbf3e3cb to your computer and use it in GitHub Desktop.
Save vilmibm/13d935e5617486c9dba3b9ecbbf3e3cb to your computer and use it in GitHub Desktop.
# CARDBOARD VR VNC TETHERING
_find_ip () {
# tethering always sets ip to the below prefix
ip addr | grep enp | grep -Eo "inet 192.168.42.[0-9]+" | grep -Eo "192.168.42.[0-9]+"
}
start_vnc () {
tethering_ip="$(_find_ip)"
if [ -z "$tethering_ip" ]; then
echo "could not find tethering IP. Are you USB tethered?"
else
x11vnc -auth /home/vilmibm/.Xauthority -scale 2/3 -allow "192.168.42." -bg 2&>/dev/null
echo "VNC running at $tethering_ip. Don't forget to use 64 colors on the VR VNC client."
fi
}
stop_vnc () {
killall x11vnc
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment