Procházet zdrojové kódy

searx configuration menu style

Bob Mottram před 7 roky
rodič
revize
aebb250cb7
1 změnil soubory, kde provedl 11 přidání a 18 odebrání
  1. 11
    18
      src/freedombone-app-searx

+ 11
- 18
src/freedombone-app-searx Zobrazit soubor

@@ -175,29 +175,22 @@ function searx_enable_login {
175 175
 }
176 176
 
177 177
 function configure_interactive_searx {
178
+    W=(1 $"Set a background image"
179
+       2 $"Enable login")
180
+
178 181
     while true
179 182
     do
180
-        data=$(mktemp 2>/dev/null)
181
-        dialog --backtitle $"Freedombone Control Panel" \
182
-               --title $"SearX Metasearch" \
183
-               --radiolist $"Choose an operation:" 12 70 3 \
184
-               1 $"Set a background image" off \
185
-               2 $"Enable login" off \
186
-               3 $"Exit" on 2> "$data"
187
-        sel=$?
188
-        case $sel in
189
-            1) rm -f "$data"
190
-               return;;
191
-            255) rm -f "$data"
192
-                 return;;
193
-        esac
194
-        case $(cat "$data") in
183
+        # shellcheck disable=SC2068
184
+        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)
185
+
186
+        if [ ! "$selection" ]; then
187
+            break
188
+        fi
189
+
190
+        case $selection in
195 191
             1) searx_set_background_image;;
196 192
             2) searx_enable_login;;
197
-            3) rm -f "$data"
198
-               break;;
199 193
         esac
200
-        rm -f "$data"
201 194
     done
202 195
 }
203 196