Skip to content

Instantly share code, notes, and snippets.

@hyang0
Created October 15, 2013 04:22
Show Gist options
  • Save hyang0/6986436 to your computer and use it in GitHub Desktop.
Save hyang0/6986436 to your computer and use it in GitHub Desktop.
vnc4server xstartup script
#!/bin/sh
release_number=`lsb_release -r|cut -f 2`
if [ $release_number = "12.04" ]; then
# Please install gnome-session-fallback at first
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
gnome-session --session=gnome-classic &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
elif [ $release_number = "13.04" ]; then
# Please install gnome-session-fallback at first
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
gnome-session-fallback &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
else
# worked for RHEL 5.8 (Tikanga)
vncconfig -iconic &
gnome-terminal -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment