From 708e0b45ea79c78b4743eef7fba37061dfe0983b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 20 May 2018 13:21:18 +0100 Subject: [PATCH] Options to switch smolrss themes --- src/freedombone-app-smolrss | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/freedombone-app-smolrss b/src/freedombone-app-smolrss index b09f5685..b5fd0379 100755 --- a/src/freedombone-app-smolrss +++ b/src/freedombone-app-smolrss @@ -155,14 +155,17 @@ function smolrss_remove_feed { function configure_interactive_smolrss { W=(1 $"Add an RSS feed" 2 $"Remove an RSS feed" - 3 $'Edit all feeds') + 3 $'Edit all feeds' + 4 $'Light theme' + 5 $'Dark theme') read_config_param SMOLRSS_DOMAIN_NAME while true do + # shellcheck disable=SC2068 - selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Smol RSS" --menu $"Choose an operation, or ESC for main menu:" 12 70 3 "${W[@]}" 3>&2 2>&1 1>&3) + selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Smol RSS" --menu $"Choose an operation, or ESC for main menu:" 14 70 5 "${W[@]}" 3>&2 2>&1 1>&3) if [ ! "$selection" ]; then break @@ -177,6 +180,18 @@ function configure_interactive_smolrss { ./create_feeds feeds.txt > feeds.xml chown www-data:www-data feeds.txt ;; + 4) cd "/var/www/$SMOLRSS_DOMAIN_NAME/htdocs" || break + cp style.light.css style.css + chown www-data:www-data style.css + dialog --title $"Smol RSS theme" \ + --msgbox $"Switched theme to light" 6 50 + ;; + 5) cd "/var/www/$SMOLRSS_DOMAIN_NAME/htdocs" || break + cp style.dark.css style.css + chown www-data:www-data style.css + dialog --title $"Smol RSS theme" \ + --msgbox $"Switched theme to dark" 6 50 + ;; esac done }