Options to switch smolrss themes

This commit is contained in:
Bob Mottram 2018-05-20 13:21:18 +01:00
parent 73f269bca7
commit 708e0b45ea
1 changed files with 17 additions and 2 deletions

View File

@ -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
}