Created
February 13, 2015 19:14
-
-
Save brandonmartinez/b8129c74b19760549577 to your computer and use it in GitHub Desktop.
Raspberry Pi VNC Boot Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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