diff --git a/kdeplasma.sh b/kdeplasma.sh index 7f964f1..20d87ad 100644 --- a/kdeplasma.sh +++ b/kdeplasma.sh @@ -26,7 +26,7 @@ ENV NVIDIA_VISIBLE_DEVICES all ENV NVIDIA_DRIVER_CAPABILITIES compute,utility # Tigervnc -COPY 20-archvnc.sh /app/init.d/20-archvnc.sh +COPY 10-tigervnc.sh 90-tigervnc.sh /app/init.d/ RUN chmod +x /app/init.d/* # Reset user home directory @@ -34,16 +34,33 @@ USER user WORKDIR /home/user Dockerfile -# KDE setup -cat >20-archvnc.sh <<- 'entrypoint' +## Plasma/tigervnc Setup +cat >10-tigervnc.sh <<- '10-tigervnc.sh' #!/usr/bin/env bash -# Disable KDE screenlock -cat >~/.config/kscreenlockerrc <<- 'kscreenlockerrc' -[Daemon] -Autolock=false -LockOnResume=false -Timeout=0 -kscreenlockerrc +# Check for MYVNC_VNCPASS variable +if [ -z ${MYVNC_VNCPASS} ] +then + echo "MYVNC_VNCPASS env variable is missing" + exit 1 +fi + +# Configure tigervnc auth +if [ ! -f ~/.vnc/passwd ] +then + echo "${MYVNC_VNCPASS}" | vncpasswd -f >~/.vnc/passwd + chmod 0600 ~/.vnc/passwd +fi + +# Remove VNCPASS env +unset MYVNC_VNCPASS + +# VNC xstartup +install /dev/stdin ~/.vnc/xstartup <<- xstartup +#!/usr/bin/env bash +unset SESSION_MANAGER +unset DBUS_SESSION_BUS_ADDRESS +exec ${STARTXBIN} +xstartup # Turn vnc sharing on/off if [[ ${MYVNC_VNCSHARING} == "true" ]] || [[ ${MYVNC_VNCSHARING} == "1" ]] @@ -63,12 +80,27 @@ depth=32 ${_MYVNC_VNCSHARING} vncconfig +# Disable KDE screenlock +cat >~/.config/kscreenlockerrc <<- 'kscreenlockerrc' +[Daemon] +Autolock=false +LockOnResume=false +Timeout=0 +kscreenlockerrc + # SSH config if [ -f ~/.ssh/id_ed25519 ] then chmod 0600 ~/.ssh/id_ed25519 fi -entrypoint +10-tigervnc.sh + +## TigerVNC launch script +cat >90-tigervnc.sh <<- '90-tigervnc.sh' +#!/usr/bin/env bash +# Launch Tigervnc +/usr/bin/dbus-launch vncserver :0 & +90-tigervnc.sh ## Docker build DOCKER_BUILDKIT=1 docker build ./. \