aboutsummaryrefslogtreecommitdiff
path: root/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.sh')
-rw-r--r--recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.sh b/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.sh
new file mode 100644
index 0000000..94de046
--- /dev/null
+++ b/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+X11VNC__SH_ENV="/home/root/.x11vnc_env"
+X11VNC_HOME="/home/root"
+
+# create this environment setup file for the shell in the x11vnc session
+[ -f "${X11VNC__SH_ENV}" ] || {
+cat <<EOF > "${X11VNC__SH_ENV}"
+
+# this file is created by the script ‘/usr/bin/de10-nano-x11vnc-init.sh’.
+#
+
+# this file is assigned to the ENV environment variable which is evaluated
+# when /bin/sh is executed. We use this to setup environment variables for
+# that shell.
+
+export PS1='\u@\h:\w$ '
+EOF
+}
+
+# then execute this command to start the x11vnc session
+FD_PROG=/usr/bin/xfce4-session \
+/usr/bin/x11vnc \
+-loop \
+-repeat \
+-env ENV="${X11VNC__SH_ENV}" \
+-env HOME="${X11VNC_HOME}" \
+-display WAIT:cmd=FINDCREATEDISPLAY-Xvfb
+