Update kdeplasma.sh

This commit is contained in:
myve 2024-07-16 21:11:49 +00:00
commit 0b20f9354c

View file

@ -26,7 +26,7 @@ ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
# Tigervnc # 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/* RUN chmod +x /app/init.d/*
# Reset user home directory # Reset user home directory
@ -34,16 +34,33 @@ USER user
WORKDIR /home/user WORKDIR /home/user
Dockerfile Dockerfile
# KDE setup ## Plasma/tigervnc Setup
cat >20-archvnc.sh <<- 'entrypoint' cat >10-tigervnc.sh <<- '10-tigervnc.sh'
#!/usr/bin/env bash #!/usr/bin/env bash
# Disable KDE screenlock # Check for MYVNC_VNCPASS variable
cat >~/.config/kscreenlockerrc <<- 'kscreenlockerrc' if [ -z ${MYVNC_VNCPASS} ]
[Daemon] then
Autolock=false echo "MYVNC_VNCPASS env variable is missing"
LockOnResume=false exit 1
Timeout=0 fi
kscreenlockerrc
# 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 # Turn vnc sharing on/off
if [[ ${MYVNC_VNCSHARING} == "true" ]] || [[ ${MYVNC_VNCSHARING} == "1" ]] if [[ ${MYVNC_VNCSHARING} == "true" ]] || [[ ${MYVNC_VNCSHARING} == "1" ]]
@ -63,12 +80,27 @@ depth=32
${_MYVNC_VNCSHARING} ${_MYVNC_VNCSHARING}
vncconfig vncconfig
# Disable KDE screenlock
cat >~/.config/kscreenlockerrc <<- 'kscreenlockerrc'
[Daemon]
Autolock=false
LockOnResume=false
Timeout=0
kscreenlockerrc
# SSH config # SSH config
if [ -f ~/.ssh/id_ed25519 ] if [ -f ~/.ssh/id_ed25519 ]
then then
chmod 0600 ~/.ssh/id_ed25519 chmod 0600 ~/.ssh/id_ed25519
fi 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 build
DOCKER_BUILDKIT=1 docker build ./. \ DOCKER_BUILDKIT=1 docker build ./. \