aboutsummaryrefslogtreecommitdiff
path: root/recipes-misc/de10-nano-x11vnc-init/files
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-misc/de10-nano-x11vnc-init/files')
-rw-r--r--recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.service9
-rw-r--r--recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.sh29
2 files changed, 38 insertions, 0 deletions
diff --git a/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.service b/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.service
new file mode 100644
index 0000000..a240722
--- /dev/null
+++ b/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=DE10-Nano X11VNC server
+Documentation=man:x11vnc
+
+[Service]
+ExecStart=/usr/bin/de10-nano-x11vnc-init.sh
+
+[Install]
+WantedBy=multi-user.target
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
+