searx configuration menu style

This commit is contained in:
Bob Mottram 2018-04-04 13:14:35 +01:00
parent 85b7fbdecd
commit aebb250cb7
1 changed files with 11 additions and 18 deletions

View File

@ -175,29 +175,22 @@ function searx_enable_login {
}
function configure_interactive_searx {
W=(1 $"Set a background image"
2 $"Enable login")
while true
do
data=$(mktemp 2>/dev/null)
dialog --backtitle $"Freedombone Control Panel" \
--title $"SearX Metasearch" \
--radiolist $"Choose an operation:" 12 70 3 \
1 $"Set a background image" off \
2 $"Enable login" off \
3 $"Exit" on 2> "$data"
sel=$?
case $sel in
1) rm -f "$data"
return;;
255) rm -f "$data"
return;;
esac
case $(cat "$data") in
# shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"SearX" --menu $"Choose an operation, or ESC to exit:" 10 60 2 "${W[@]}" 3>&2 2>&1 1>&3)
if [ ! "$selection" ]; then
break
fi
case $selection in
1) searx_set_background_image;;
2) searx_enable_login;;
3) rm -f "$data"
break;;
esac
rm -f "$data"
done
}