Skip to content

Instantly share code, notes, and snippets.

@jettero
Last active February 4, 2016 07:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jettero/0d0be0fa3582ca0c9e96 to your computer and use it in GitHub Desktop.
Save jettero/0d0be0fa3582ca0c9e96 to your computer and use it in GitHub Desktop.
Chrome Remote Desktop, actual remote desktop instead of a remote X session
#!/bin/bash
ACTUAL_DISPLAY=:0
NUM=$(echo $DISPLAY | sed s/://)
PORT="55$NUM"
TARGET=127.0.0.1:$PORT
function killthemall() {
echo;echo "-----------------:= $(date) killing all running vncviewers and x11vncs"
for tokill in x11vnc vncviewer; do
while killall $tokill; do
echo killed some $tokill
done
done
}
echo;echo
echo;echo "-----------------:= $(date) starting $0"
killthemall
echo;echo "-----------------:= $(date) starting vncviewer"
vncviewer -encodings 'copyrect tight zrle hextile' \
-fullscreen -truecolour -compresslevel 0 -quality 9 \
-listen \
&
echo;echo "-----------------:= $(state) starting x11vnc in connect mode, target=$TARGET"
x11vnc -nopw -display $ACTUAL_DISPLAY \
-noxrecord -noxfixes -noxdamage \
--connect_or_exit 127.0.0.1:$PORT
echo;echo "-----------------:= $(state) x11vnc stopped, shutting down $0"
killthemall
echo;echo
export CHROME_REMOTE_DESKTOP_DEFAULT_DESKTOP_SIZES=3840x1080
export CHROME_REMOTE_DESKTOP_LOG_FILE=~/.chrome-remote-desktop.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment