Add kdeplasma

This commit is contained in:
Myve 2024-07-19 07:05:19 +00:00
commit 43b35b07be
4 changed files with 84 additions and 0 deletions

50
plasma/10-tigervnc.sh Executable file
View file

@ -0,0 +1,50 @@
#!/usr/bin/env bash
# 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" ]]
then
_MYVNC_VNCSHARING=alwaysshared
else
_MYVNC_VNCSHARING=nevershared
fi
# VNC config
cat >~/.vnc/config <<- vncconfig
session=plasmax11
geometry=1920x1080
framerate=60
depth=32
${_MYVNC_VNCSHARING}
vncconfig
# Disable KDE screenlock
cat >~/.config/kscreenlockerrc <<- 'kscreenlockerrc'
[Daemon]
Autolock=false
LockOnResume=false
Timeout=0
kscreenlockerrc

3
plasma/90-tigervnc.sh Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
# Launch Tigervnc
vncserver :0 &

25
plasma/Dockerfile Normal file
View file

@ -0,0 +1,25 @@
# syntax = docker/dockerfile:1.2
FROM alpine/base
USER root
# X session environment variable
ENV STARTXBIN startplasma-x11
# Run
RUN apk add --no-cache \
tigervnc \
plasma-desktop-meta \
font-dejavu \
firefox \
&& printf '%s\n' 'permit nopass user as root cmd /sbin/apk add' >/etc/doas.conf
# configure nvidia container runtime
# https://github.com/NVIDIA/nvidia-container-runtime#environment-variables-oci-spec
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
# Tigervnc initialization scripts
COPY *.sh /app/init.d/
# Reset user home directory
USER user

6
plasma/build Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Docker build
# Optional: buildtag
DOCKER_BUILDKIT=1 \
docker build . \
--tag ${buildtag:-alpine/webtop:plasma}