From 9a460b27e691e31f7c9a9204a0e87251898fae21 Mon Sep 17 00:00:00 2001 From: "Josh.5" Date: Mon, 18 Sep 2023 01:49:39 +1200 Subject: [PATCH] Add some forced changes to the way the desktop looks --- Dockerfile.debian | 5 +- overlay/etc/cont-init.d/10-setup_user.sh | 7 -- .../etc/cont-init.d/70-configure_desktop.sh | 2 + .../home_directory_template/.bashrc | 0 .../.cache/log/.placeholder | 0 .../.config/mimeapps.list | 0 .../.config/xfce4/helpers.rc | 0 .../xfce-perchannel-xml/xfce4-desktop.xml | 18 ++++ .../xfce-perchannel-xml/xfce4-panel.xml | 21 +++-- .../xfconf/xfce-perchannel-xml/xfwm4.xml | 92 +++++++++++++++++++ .../xfconf/xfce-perchannel-xml/xsettings.xml | 10 +- .../xfce4/helpers/custom-WebBrowser.desktop | 0 overlay/usr/bin/start-desktop.sh | 11 ++- 13 files changed, 145 insertions(+), 21 deletions(-) rename overlay/{etc => templates}/home_directory_template/.bashrc (100%) rename overlay/{etc => templates}/home_directory_template/.cache/log/.placeholder (100%) rename overlay/{etc => templates}/home_directory_template/.config/mimeapps.list (100%) rename overlay/{etc => templates}/home_directory_template/.config/xfce4/helpers.rc (100%) rename overlay/{etc => templates}/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml (73%) rename overlay/{etc => templates}/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml (80%) create mode 100644 overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml rename overlay/{etc => templates}/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml (85%) rename overlay/{etc => templates}/home_directory_template/.local/share/xfce4/helpers/custom-WebBrowser.desktop (100%) diff --git a/Dockerfile.debian b/Dockerfile.debian index 7c06e32..98d1ca9 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -363,8 +363,11 @@ RUN \ && echo '' > /opt/frontend/index.html \ && echo '

If you are not redirected, click here.

' >> /opt/frontend/index.html \ && chmod -R 755 /opt/frontend \ + && convert /opt/frontend/web/images/icons/novnc-ios-180.png -resize "128x128" /tmp/steam-headless.png \ + && xdg-icon-resource install --novendor --size 128 /tmp/steam-headless.png \ && \ - echo + echo "**** Section cleanup ****" \ + && rm -f /tmp/steam-headless.png # Install Websockify ARG WEBSOCKETIFY_VERSION=0.11.0 diff --git a/overlay/etc/cont-init.d/10-setup_user.sh b/overlay/etc/cont-init.d/10-setup_user.sh index f2ac554..16fb70c 100644 --- a/overlay/etc/cont-init.d/10-setup_user.sh +++ b/overlay/etc/cont-init.d/10-setup_user.sh @@ -79,13 +79,6 @@ ln -sf /usr/share/backgrounds/steam.jpg /etc/alternatives/desktop-background chmod a+r /etc/alternatives/desktop-background -# Setup home directory and permissions -echo "Adding default home directory template" -mkdir -p ${USER_HOME} -chown -R ${PUID}:${PGID} /etc/home_directory_template -rsync -aq --ignore-existing /etc/home_directory_template/ ${USER_HOME}/ - - # Setup services log path echo "Setting ownership of all log files in '${USER_HOME}/.cache/log'" mkdir -p "${USER_HOME}/.cache/log" diff --git a/overlay/etc/cont-init.d/70-configure_desktop.sh b/overlay/etc/cont-init.d/70-configure_desktop.sh index 56b3c7d..99fe7ff 100644 --- a/overlay/etc/cont-init.d/70-configure_desktop.sh +++ b/overlay/etc/cont-init.d/70-configure_desktop.sh @@ -8,5 +8,7 @@ else echo "Desktop service not available when container is run in 'secondary' mode." sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/desktop.ini fi +echo "Ensure home directory template is owned by the default user." +chown -R ${PUID}:${PGID} /templates/home_directory_template echo "DONE" diff --git a/overlay/etc/home_directory_template/.bashrc b/overlay/templates/home_directory_template/.bashrc similarity index 100% rename from overlay/etc/home_directory_template/.bashrc rename to overlay/templates/home_directory_template/.bashrc diff --git a/overlay/etc/home_directory_template/.cache/log/.placeholder b/overlay/templates/home_directory_template/.cache/log/.placeholder similarity index 100% rename from overlay/etc/home_directory_template/.cache/log/.placeholder rename to overlay/templates/home_directory_template/.cache/log/.placeholder diff --git a/overlay/etc/home_directory_template/.config/mimeapps.list b/overlay/templates/home_directory_template/.config/mimeapps.list similarity index 100% rename from overlay/etc/home_directory_template/.config/mimeapps.list rename to overlay/templates/home_directory_template/.config/mimeapps.list diff --git a/overlay/etc/home_directory_template/.config/xfce4/helpers.rc b/overlay/templates/home_directory_template/.config/xfce4/helpers.rc similarity index 100% rename from overlay/etc/home_directory_template/.config/xfce4/helpers.rc rename to overlay/templates/home_directory_template/.config/xfce4/helpers.rc diff --git a/overlay/etc/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml b/overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml similarity index 73% rename from overlay/etc/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml rename to overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml index 1b326c0..8f65b08 100644 --- a/overlay/etc/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml +++ b/overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml @@ -49,5 +49,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/overlay/etc/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml b/overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml similarity index 80% rename from overlay/etc/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml rename to overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml index c18e4f9..30da6ee 100644 --- a/overlay/etc/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml +++ b/overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml @@ -7,15 +7,14 @@ - + - - + + - @@ -25,10 +24,15 @@ + + + - + + + @@ -36,7 +40,6 @@ - @@ -52,9 +55,11 @@ - + + + - + \ No newline at end of file diff --git a/overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml b/overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml new file mode 100644 index 0000000..2ba0ebc --- /dev/null +++ b/overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay/etc/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml b/overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml similarity index 85% rename from overlay/etc/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml rename to overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml index cd0228c..1af8c87 100644 --- a/overlay/etc/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml +++ b/overlay/templates/home_directory_template/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml @@ -14,7 +14,7 @@ - + @@ -32,7 +32,7 @@ - + @@ -41,4 +41,8 @@ - + + + + + \ No newline at end of file diff --git a/overlay/etc/home_directory_template/.local/share/xfce4/helpers/custom-WebBrowser.desktop b/overlay/templates/home_directory_template/.local/share/xfce4/helpers/custom-WebBrowser.desktop similarity index 100% rename from overlay/etc/home_directory_template/.local/share/xfce4/helpers/custom-WebBrowser.desktop rename to overlay/templates/home_directory_template/.local/share/xfce4/helpers/custom-WebBrowser.desktop diff --git a/overlay/usr/bin/start-desktop.sh b/overlay/usr/bin/start-desktop.sh index f0c14ca..515a9d4 100755 --- a/overlay/usr/bin/start-desktop.sh +++ b/overlay/usr/bin/start-desktop.sh @@ -31,16 +31,23 @@ export XDG_CONFIG_HOME="${USER_HOME:?}/.config" export XDG_DATA_HOME="${USER_HOME:?}/.local/share" # EXECUTE PROCESS: +# Setup home directory +if [[ ! -f /tmp/.home-directory-template-updated ]]; then + echo "Installing default home directory template" + mkdir -p "${USER_HOME:?}" + rsync -aq /templates/home_directory_template/ "${USER_HOME:?}"/ + touch /tmp/.home-directory-template-updated +fi # Wait for the X server to start wait_for_x # Install/Upgrade user apps -if [[ ! -f /tmp/.desktop-apps-updated.lock ]]; then +if [[ ! -f /tmp/.desktop-apps-updated ]]; then xterm -geometry 200x50+0+0 -ls -e /bin/bash -c " source /usr/bin/install_firefox.sh; source /usr/bin/install_protonup.sh; sleep 1; " - touch /tmp/.desktop-apps-updated.lock + touch /tmp/.desktop-apps-updated fi # Run the desktop environment