diff options
author | Alex Balgavy <alex@balgavy.eu> | 2023-10-07 21:05:46 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2023-10-09 18:13:00 +0200 |
commit | 5d53aac20f0cb0737bb475d51ce429e8547d3e33 (patch) | |
tree | f1dbebc2b8f5a221b2839ad822e94b46fac88253 | |
parent | ff78b1a90265449495bc0200c6fa7706f4466468 (diff) | |
download | searxng-5d53aac20f0cb0737bb475d51ce429e8547d3e33.tar.gz searxng-5d53aac20f0cb0737bb475d51ce429e8547d3e33.zip |
[mod] add hotkeys option to settings.yml
The change in the hotkey mechanism introduced in 317db5b04 does not allow
configuration via `settings.yml`. This commit adds that functionality.
Closes: #2898
-rw-r--r-- | docs/admin/settings/settings_ui.rst | 4 | ||||
-rw-r--r-- | searx/preferences.py | 2 | ||||
-rw-r--r-- | searx/settings.yml | 2 | ||||
-rw-r--r-- | searx/settings_defaults.py | 1 |
4 files changed, 8 insertions, 1 deletions
diff --git a/docs/admin/settings/settings_ui.rst b/docs/admin/settings/settings_ui.rst index 0039f6fb2..a5d1076ec 100644 --- a/docs/admin/settings/settings_ui.rst +++ b/docs/admin/settings/settings_ui.rst @@ -20,6 +20,7 @@ theme_args: simple_style: auto search_on_category_select: true + hotkeys: default .. _static_use_hash: @@ -64,3 +65,6 @@ ``search_on_category_select``: Perform search immediately if a category selected. Disable to select multiple categories. + +``hotkeys``: + Hotkeys to use in the search interface: ``default``, ``vim`` (Vim-like). diff --git a/searx/preferences.py b/searx/preferences.py index c65a9b9d0..ad0e2867e 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -466,7 +466,7 @@ class Preferences: locked=is_locked('search_on_category_select') ), 'hotkeys': EnumStringSetting( - 'default', + settings['ui']['hotkeys'], choices=['default', 'vim'] ), # fmt: on diff --git a/searx/settings.yml b/searx/settings.yml index 2e78c8f2d..695b7f812 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -127,6 +127,8 @@ ui: # Perform search immediately if a category selected. # Disable to select multiple categories at once and start the search manually. search_on_category_select: true + # Hotkeys: default or vim + hotkeys: default # Lock arbitrary settings on the preferences page. To find the ID of the user # setting you want to lock, check the ID of the form on the page "preferences". diff --git a/searx/settings_defaults.py b/searx/settings_defaults.py index ad45f8617..a0d0daa09 100644 --- a/searx/settings_defaults.py +++ b/searx/settings_defaults.py @@ -201,6 +201,7 @@ SCHEMA = { 'infinite_scroll': SettingsValue(bool, False), 'cache_url': SettingsValue(str, 'https://web.archive.org/web/'), 'search_on_category_select': SettingsValue(bool, True), + 'hotkeys': SettingsValue(('default', 'vim'), 'default'), }, 'preferences': { 'lock': SettingsValue(list, []), |