diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index 1a2287b9..05d4595c 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -3,8 +3,10 @@ on: push: branches: - master + - develop + - testing paths: - - 'docker-mods/**' + - '**/docker-mods/**' workflow_dispatch: inputs: app: @@ -43,6 +45,7 @@ on: append-tag: required: false description: 'Append a the tag with "-custom" e.g :radarr-testing' + jobs: push_to_ghcr_io: runs-on: ubuntu-latest @@ -51,46 +54,47 @@ jobs: uses: actions/checkout@v3.1.0 with: fetch-depth: 0 - - name: get changed files - id: getfile - run: | - echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)" >> $GITHUB_ENV - name: Login to GitHub Container Registry uses: docker/login-action@v2.1.0 with: registry: ghcr.io - username: ${{ github.repository_owner }} + username: ${{ secrets.GHCR_USER }} password: ${{ secrets.GH_PAT }} - - name: find correct directory then build&push + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: build all on push if: ${{ github.event_name == 'push' }} run: | - for i in ${{ env.files }} - do - directory="$( echo $i | cut -d'/' -f2 -s )" - if [ -z "$directory" ]; then - continue # Skip root dir - elif [ "$i" == *.md ]; then - continue # Skip markdown files - elif [ "$i" == *.yml ]; then - continue # Skip YAML files - fi - docker build docker-mods/$directory --tag ghcr.io/gilbn/theme.park:$directory - docker push ghcr.io/gilbn/theme.park:$directory - done + branch=${{ steps.extract_branch.outputs.branch }} + + if [ "$branch" = "master" ]; then + branch="" + else + branch="-$branch" + fi + for dir in docker-mods/*; + do + app="$( echo "$dir" | cut -d'/' -f2 -s )" + docker build docker-mods/$app --tag ghcr.io/${{ secrets.GHCR_USER }}/theme.park:$app$branch + docker push ghcr.io/${{ secrets.GHCR_USER }}/theme.park:$app$branch + done - name: manually build if: ${{ github.event.inputs.app && github.event.inputs.app != 'build-all-the-mods' }} run: | - docker build docker-mods/${{ github.event.inputs.app }} --tag ghcr.io/gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} - docker push ghcr.io/gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} + docker build docker-mods/${{ github.event.inputs.app }} --tag ghcr.io/${{ secrets.GHCR_USER }}/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} + docker push ghcr.io/${{ secrets.GHCR_USER }}/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} - name: manually build all mods if: ${{ github.event.inputs.app == 'build-all-the-mods' }} run: | for dir in docker-mods/*; do app="$( echo "$dir" | cut -d'/' -f2 -s )" - docker build docker-mods/$app --tag ghcr.io/gilbn/theme.park:$app${{ github.event.inputs.append-tag }} - docker push ghcr.io/gilbn/theme.park:$app${{ github.event.inputs.append-tag }} + docker build docker-mods/$app --tag ghcr.io/${{ secrets.GHCR_USER }}/theme.park:$app${{ github.event.inputs.append-tag }} + docker push ghcr.io/${{ secrets.GHCR_USER }}/theme.park:$app${{ github.event.inputs.append-tag }} done + push_to_dockerhub: runs-on: ubuntu-latest steps: @@ -98,42 +102,42 @@ jobs: uses: actions/checkout@v3.1.0 with: fetch-depth: 0 - - name: get changed files - id: getfile - run: | - echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)" >> $GITHUB_ENV - name: Login to Docker Hub uses: docker/login-action@v2.1.0 with: username: ${{ secrets.DH_USER }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: find correct directory then build&push + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: build all on push if: ${{ github.event_name == 'push' }} run: | - for i in ${{ env.files }} - do - directory="$( echo $i | cut -d'/' -f2 -s )" - if [ -z "$directory" ]; then - continue # Skip root dir - elif [ "$i" == *.md ]; then - continue # Skip markdown files - elif [ "$i" == *.yml ]; then - continue # Skip YAML files - fi - docker build docker-mods/$directory --tag gilbn/theme.park:$directory - docker push gilbn/theme.park:$directory - done + branch=${{ steps.extract_branch.outputs.branch }} + + if [ "$branch" = "master" ]; then + branch="" + else + branch="-$branch" + fi + for dir in docker-mods/*; + do + app="$( echo "$dir" | cut -d'/' -f2 -s )" + docker build docker-mods/$app --tag ${{ secrets.DH_USER }}/theme.park:$app$branch + docker push ${{ secrets.DH_USER }}/theme.park:$app$branch + done - name: manually build if: ${{ github.event.inputs.app && github.event.inputs.app != 'build-all-the-mods' }} run: | - docker build docker-mods/${{ github.event.inputs.app }} --tag gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} - docker push gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} + docker build docker-mods/${{ github.event.inputs.app }} --tag ${{ secrets.DH_USER }}/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} + docker push ${{ secrets.DH_USER }}/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }} - name: manually build all mods if: ${{ github.event.inputs.app == 'build-all-the-mods' }} run: | for dir in docker-mods/*; do app="$( echo "$dir" | cut -d'/' -f2 -s )" - docker build docker-mods/$app --tag gilbn/theme.park:$app${{ github.event.inputs.append-tag }} - docker push gilbn/theme.park:$app${{ github.event.inputs.append-tag }} + docker build docker-mods/$app --tag ${{ secrets.DH_USER }}/theme.park:$app${{ github.event.inputs.append-tag }} + docker push ${{ secrets.DH_USER }}/theme.park:$app${{ github.event.inputs.append-tag }} done diff --git a/css/addons/unraid/local.sh b/css/addons/unraid/local.sh new file mode 100644 index 00000000..7858172c --- /dev/null +++ b/css/addons/unraid/local.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# Theme-Park Theme CSS Synchronization Script +# +# This script synchronizes the CSS files needed for the theme-park.dev Unraid theme +# into the Dynamix CSS styles folder. The script creates destination subfolders if +# they don't exist and performs rsync for each subfolder. It then updates the @import references +# in the CSS files so the files get correctly loaded by the client. +# +# This script is intended for users of the "Theme Engine" plugin, allowing custom +# styling to be added into the HTML head that references the copied CSS files. +# +# After running this script, you can use the following code snippet as an example +# in your HTML head (Custom styling (advanced)) to include the copied CSS files using the "Theme Engine" plugin: +# +# +# +# +# +# Tip: You can use the "User Scripts" plugin in Unraid to schedule this script to run +# automatically when the Unraid array starts. +# + +# Define root source folder (CHANGE THIS TO YOUR DESIRED SOURCE FOLDER) +root_source_folder="/path/to/the/theme-park/root/folder" + + +# -------------------- Start of Script -------------------- +# Define subfolders +subfolders=("base/unraid" "theme-options" "defaults" "community-theme-options") + +# Main destination folder +main_destination_folder="/usr/local/emhttp/plugins/dynamix/styles/theme-park/css/" + +# User instructions +# Instructions: Only change the 'root_source_folder' variable to point to your desired source directory. +# Do NOT modify other variables unless you understand their purpose. + +# Create subfolders if they don't exist +for subfolder in "${subfolders[@]}"; do + destination_folder="$main_destination_folder$subfolder" + if [ ! -d "$destination_folder" ]; then + echo "Destination folder not found. Creating destination folder: $destination_folder" + mkdir -p "$destination_folder" + fi +done + +# Perform rsync for each subfolder to its corresponding destination +for subfolder in "${subfolders[@]}"; do + source_folder="$root_source_folder/$subfolder" + destination_folder="$main_destination_folder$subfolder" + + # Check if source folder exists + if [ ! -d "$source_folder" ]; then + echo "Source folder not found: $source_folder" + exit 1 + fi + + rsync -av --delete "$source_folder/" "$destination_folder" + echo "Synchronization complete for source: $source_folder to destination: $destination_folder" +done + +# Update import references in CSS files so the the files get correctly loaded on the client +echo "Updating import references..." +find "$main_destination_folder" -type f -name "*.css" -exec sed -i 's|@import url("/css/|@import url("/webGui/styles/theme-park/css/|g' {} + + +echo "Reference update complete." + +# ---- End of Script ---- + +echo "All synchronizations complete." diff --git a/css/base/gitea/gitea-base.css b/css/base/gitea/gitea-base.css index 9f43e61c..19fc2129 100644 --- a/css/base/gitea/gitea-base.css +++ b/css/base/gitea/gitea-base.css @@ -24,7 +24,11 @@ --color-primary: rgb(var(--gitea-color-primary-dark-4),.6); --color-primary-dark-2: rgb(var(--gitea-color-primary-dark-4),.8); --color-primary-dark-4: rgb(var(--gitea-color-primary-dark-4)); - } + --color-nav-bg: var(--main-bg-color); + --color-button: transparent; + --color-menu: transparent; + --color-footer: transparent; +} body { background: var(--main-bg-color); diff --git a/css/base/transmission/transmission-base.css b/css/base/transmission/transmission-base.css index 732d51ac..dd90df38 100644 --- a/css/base/transmission/transmission-base.css +++ b/css/base/transmission/transmission-base.css @@ -285,23 +285,27 @@ div#toolbar>div#toolbar-inspector:before { } ul.torrent_list, -ul.torrent_list li.torrent.even { - background: var(--transparency-dark-25) +ul.torrent_list li.torrent.even, +ul.torrent-list, +ul.torrent-list li.torrent.even { + background: var(--transparency-dark-25) !important; } ul.torrent_list li.torrent div.torrent_name { color: var(--text-hover); } -ul.torrent_list li.torrent.selected { - background: var(--transparency-dark-25); +ul.torrent_list li.torrent.selected, +ul.torrent-list li.torrent.selected { + background: var(--transparency-dark-50) !important; } -ul.torrent_list li.torrent { +ul.torrent_list li.torrent, +ul.torrent-list li.torrent { border-bottom: 1px solid rgba(204, 204, 204, 0.1); padding: 4px 30px 5px 14px; color: var(--text); - background: var(--transparency-light-10); + background: var(--transparency-light-10) !important; } /* Modal */ @@ -961,7 +965,9 @@ div.torrent_footer #compact-button.selected:before { /*Compact mode*/ ul.torrent_list li.torrent div.torrent_name.paused, -ul.torrent_list li.torrent.compact div.torrent_name { +ul.torrent_list li.torrent.compact div.torrent_name, +ul.torrent-list li.torrent div.torrent_name.paused, +ul.torrent-list li.torrent.compact div.torrent_name { color: var(--text); } @@ -982,4 +988,4 @@ ul.torrent_list li.torrent.compact div.torrent_name { .ui-icon, .ui-widget-content .ui-icon { background-image: url(/resources/transmission/icons.png); -} \ No newline at end of file +} diff --git a/docker-mods/lidarr/root/etc/cont-init.d/98-themepark b/docker-mods/lidarr/root/etc/cont-init.d/98-themepark index d782d345..416c756e 100755 --- a/docker-mods/lidarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/lidarr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/lidarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/lidarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index 14083437..387dcb9e 100755 --- a/docker-mods/lidarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/lidarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/prowlarr/root/etc/cont-init.d/98-themepark b/docker-mods/prowlarr/root/etc/cont-init.d/98-themepark index 537108d8..541878d5 100755 --- a/docker-mods/prowlarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/prowlarr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/prowlarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/prowlarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index bd68c4a9..16b0285f 100755 --- a/docker-mods/prowlarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/prowlarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/radarr/root/etc/cont-init.d/98-themepark b/docker-mods/radarr/root/etc/cont-init.d/98-themepark index 2945c949..aaba7e32 100755 --- a/docker-mods/radarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/radarr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/radarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/radarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index bc39ae49..555ab472 100755 --- a/docker-mods/radarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/radarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/readarr/root/etc/cont-init.d/98-themepark b/docker-mods/readarr/root/etc/cont-init.d/98-themepark index 00e30314..ac247e57 100755 --- a/docker-mods/readarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/readarr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s/// /g" "${APP_FILEPATH}" - sed -i "s/// /g" "${APP_FILEPATH}" - sed -i "s/// /g" "${LOGIN_FILEPATH}" - sed -i "s/// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s/// /g" "${APP_FILEPATH}" - sed -i "s/// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' fi diff --git a/docker-mods/readarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/readarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index 19ac27f2..b6c21926 100755 --- a/docker-mods/readarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/readarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s/// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' fi diff --git a/docker-mods/sonarr/root/etc/cont-init.d/98-themepark b/docker-mods/sonarr/root/etc/cont-init.d/98-themepark index 501578f2..0a4a71e1 100755 --- a/docker-mods/sonarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/sonarr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/sonarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/sonarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index a854a510..11d97d71 100755 --- a/docker-mods/sonarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/sonarr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index 45c27963..13bfa7ad 100755 --- a/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/transmission/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -43,8 +43,13 @@ if ! grep -q "${TP_DOMAIN}/css/base" /usr/share/transmission/web/index.html; the echo '---------------------------' echo '| Adding the stylesheet |' echo '---------------------------' + echo 'There may be 2 missing file errors right now. If there''s only 2 you may safely' + echo 'ignore them as they''re there for backwards compatability. If there are more' + echo 'errors than that, something went wrong.' sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/web/index.html sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/web/index.html + sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/public_html/index.html + sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/public_html/index.html printf 'Stylesheet set to %s\n' "${TP_THEME} " -fi \ No newline at end of file +fi diff --git a/docker-mods/whisparr/root/etc/cont-init.d/98-themepark b/docker-mods/whisparr/root/etc/cont-init.d/98-themepark index c8ab5aa8..a34e6089 100755 --- a/docker-mods/whisparr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/whisparr/root/etc/cont-init.d/98-themepark @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/docker-mods/whisparr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/whisparr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index 1647b4f2..cdea12d6 100755 --- a/docker-mods/whisparr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/whisparr/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -50,18 +50,22 @@ fi # Adding stylesheets if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then echo '---------------------------' - echo '| Adding the stylesheet |' + echo '| Adding the stylesheets |' echo '---------------------------' - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + + url_base="${TP_SCHEME}://${TP_DOMAIN}" + sheets="" + sheets="${sheets} " printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do - sed -i "s// /g" "${APP_FILEPATH}" - sed -i "s// /g" "${LOGIN_FILEPATH}" + sheets="${sheets} " printf 'Added custom addon: %s\n\n' "${addon}" done fi -fi \ No newline at end of file + + sed -i "s!!${sheets}!g" "${APP_FILEPATH}" + sed -i "s!!${sheets}!g" "${LOGIN_FILEPATH}" + printf 'Stylesheets inserted.' +fi diff --git a/themes.py b/themes.py index 637afdcb..40f7b203 100644 --- a/themes.py +++ b/themes.py @@ -36,7 +36,7 @@ def create_addons_json() -> str: addon_folders = [name for name in listdir( addon_root) if isdir(join(addon_root, name))] for app in addon_folders: - app_addons = [addon for addon in listdir(f"{addon_root}/{app}")] + app_addons = [addon for addon in listdir(f"{addon_root}/{app}") if isdir(f"{addon_root}/{app}/{addon}")] ADDONS["addons"].update({ app: { addon: {} for addon in app_addons