Update plasma webtop

This commit is contained in:
myve 2024-07-25 01:26:27 +00:00
commit 7082dfb0f5
8 changed files with 169 additions and 109 deletions

21
base/mirrorlist Normal file
View file

@ -0,0 +1,21 @@
################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################
# With: reflector --country CA,US --protocol https --sort rate --age 24 --latest 10 --fastest 10 --exclude 'tyzoid|cicku'
# When: 2024-07-19 19:44:07 UTC
# From: https://archlinux.org/mirrors/status/json/
# Retrieved: 2024-07-19 19:43:57 UTC
# Last Check: 2024-07-19 19:22:47 UTC
Server = https://mirror.sfo12.us.leaseweb.net/archlinux/$repo/os/$arch
Server = https://mirror.qctronics.com/archlinux/$repo/os/$arch
Server = https://arch.mirror.constant.com/$repo/os/$arch
Server = https://mirror.wdc1.us.leaseweb.net/archlinux/$repo/os/$arch
Server = https://mirrors.vectair.net/archlinux/$repo/os/$arch
Server = https://america.mirror.pkgbuild.com/$repo/os/$arch
Server = https://mirrors.lug.mtu.edu/archlinux/$repo/os/$arch
Server = https://us.arch.niranjan.co/$repo/os/$arch
Server = https://mirror.theash.xyz/arch/$repo/os/$arch
Server = https://mirror.tmmworkshop.com/archlinux/$repo/os/$arch

8
plasma/.env Normal file
View file

@ -0,0 +1,8 @@
# .env for myvnc KDE plasma webtop
MYVNC_KDEPLASMA_PORT=
MYVNC_KDEPLASMA_VNCPASS=
MYVNC_KDEPLASMA_CUSTOM_TITLE=
MYVNC_KDEPLASMA_PROXYPATH=
MYVNC_KDEPLASMA_VNCSHARING=

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

@ -0,0 +1,51 @@
#!/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
dpi=192
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
/usr/bin/dbus-launch vncserver :0 &

31
plasma/Dockerfile Normal file
View file

@ -0,0 +1,31 @@
# syntax = docker/dockerfile:1
FROM myvnc/arch/base
USER root
# X session environment variable
ENV STARTXBIN=startplasma-x11
# Install packages
RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \
pacman -Syu --ask 4 --needed \
tigervnc \
cuda openssh vim pacman-contrib rsync git \
plasma konsole kate dolphin kompare kcalc \
jack2 ttf-dejavu \
firefox firefox-decentraleyes firefox-ublock-origin \
torbrowser-launcher \
shotwell ffmpegthumbs ark okular \
remmina libvncserver \
&& pacman -Scc --ask 4 \
&& printf '%s\n' 'Cmnd_Alias MISCELLANEOUS = /usr/bin/pacman' >/etc/sudoers.d/01-MISCELLANEOUS
# 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
COPY *.sh /app/init.d/
# Reset user home directory
USER user

View file

@ -0,0 +1,28 @@
services:
kdeplasma:
image: myvnc/arch/webtop:plasma
container_name: kdeplasma
restart: unless-stopped
build: .
ports:
- ${MYVNC_KDEPLASMA_PORT}:6900
environment:
MYVNC_VNCPASS: ${MYVNC_KDEPLASMA_VNCPASS}
MYVNC_CUSTOM_TITLE: ${MYVNC_KDEPLASMA_CUSTOM_TITLE}
MYVNC_PROXYPATH: ${MYVNC_KDEPLASMA_PROXYPATH}
MYVNC_VNCSHARING: ${MYVNC_KDEPLASMA_VNCSHARING}
networks:
- kdeplasma
# Optional
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities:
- gpu
networks:
kdeplasma:
external: false

27
plasma/up Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Docker build
# Optional buildtag
# DOCKER_BUILDKIT=1 \
# docker build . \
# --build-arg debug=${debug:-""} \
# --tag ${buildtag:-myvnc/novnc}
# Grab options
while [ ${1} ]
do
case ${1} in
-b | --build | b | build )
build="--build"
;;
-d | --detach | d | detach )
detach="--detach"
;;
bd | db )
build="--build"
detach="--detach"
;;
esac
shift
done
# Compose up
docker compose up ${build} ${detach}

View file

@ -1,109 +0,0 @@
## Dockerfile
cat >Dockerfile <<- 'Dockerfile'
# syntax = docker/dockerfile:1.2
FROM myvnc/base
USER root
# X session environment variable
ENV STARTXBIN startplasma-x11
# Install packages
RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \
pacman -Syu --ask 4 --needed \
tigervnc \
cuda openssh vim pacman-contrib rsync git \
plasma konsole kate dolphin kompare kcalc \
jack2 ttf-dejavu \
firefox firefox-decentraleyes firefox-ublock-origin \
torbrowser-launcher \
shotwell ffmpegthumbs ark okular \
remmina libvncserver \
&& pacman -Scc --ask 4 \
&& echo 'Cmnd_Alias MISCELLANEOUS = /usr/bin/pacman -S' >/etc/sudoers.d/01-MISCELLANEOUS
# 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
COPY 10-tigervnc.sh 90-tigervnc.sh /app/init.d/
RUN chmod +x /app/init.d/*
# Reset user home directory
USER user
WORKDIR /home/user
Dockerfile
## Plasma/tigervnc Setup
cat >10-tigervnc.sh <<- '10-tigervnc.sh'
#!/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
dpi=192
geometry=1920x1080
framerate=60
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
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 ./. \
--tag myvnc/webtop:plasma \
&& rm -f Dockerfile *.sh