Rework xinitrc handling: modularize the code into ~/.xinitrc.d/ and support configura...
[grml-etc.git] / etc / skel / .xinitrc.d / grml_vnc
diff --git a/etc/skel/.xinitrc.d/grml_vnc b/etc/skel/.xinitrc.d/grml_vnc
new file mode 100755 (executable)
index 0000000..eff5a40
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Filename:      ~/.xinitrc.d/grml_vnc
+# Purpose:       enable vnc if configured via bootoption
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2 or any later version.
+################################################################################
+
+if [ "$XINIT_GRML_VNC" = "false" ] ; then
+   exit 0
+fi
+
+# if the vnc bootoption sets up the password let's start the vnc server
+if [ -e $HOME/.vnc/passwd ]; then
+   /usr/bin/x11vnc -bg -forever -noxdamage -o $HOME/.vnc/x11vnc.log -rfbauth \
+                   $HOME/.vnc/passwd -auth $HOME/.Xauthority -display $DISPLAY
+fi
+
+## END OF FILE #################################################################