Skip to content

Instantly share code, notes, and snippets.

@brandonmartinez
Created February 13, 2015 19:14
Show Gist options
  • Save brandonmartinez/b8129c74b19760549577 to your computer and use it in GitHub Desktop.
Save brandonmartinez/b8129c74b19760549577 to your computer and use it in GitHub Desktop.
Raspberry Pi VNC Boot Script
# First configure the user you want to run this under - this will generally be pi, unless you've created your own users
export USER='pi'
eval cd ~$USER
# Check the state of the command - this'll either be start or stop
case "$1" in
start)
# if it's start, then start vncserver using the details below
su $USER -c '/usr/bin/vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565'
echo "Starting vncserver for $USER "
;;
stop)
# if it's stop, then just kill the process
pkill Xtightvnc
echo "vncserver stopped"
;;
*)
echo "Usage: /etc/init.d/vncserver {start|stop}"
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment