-
-
Notifications
You must be signed in to change notification settings - Fork 16
Search
Settings in plugs should be easily discoverable through the System Settings search bar and the Applications menu. To achieve this each plug should provide a search
function that returns a map with key value pairs:
- Key: setting path, like:
Applications → Default → Web browser
Keyboard → Shortcuts
Keyboard → Layout → Compose Key
Displays → Night Light → Color temperature
Mouse & Touchpad → Middle click paste
- Value: location of setting. Like:
"defaults"
"Shortcuts"
"Layout"
"night-light"
""
In case of Search in System Settings, the query is matched to the setting paths. When the user selects a matching result the settings location is passed to the search_callback
, this enables System Settings to open the plug on the right page (location). If the location is empty the Plug is opened with it's default page.
In case of the Applications menu it needs to open the right location through a URI, like:
settings://applications/defaults
settings://input/keyboard
settings://input/keyboard/shortcuts
settings://display/night-light
settings://input/mouse
See: System Settings Schema Specification
For that to work it looks up the uri in supported_settings
using the location. For example:
- The user searches for "shortcuts"
- This is matched to
Keyboard → Shortcuts
which has the location:"Shortcuts"
. - This location is looked up in
supported_settings
, findinginput/keyboard/shortcuts
. - This is used to form the uri:
settings://input/keyboard/shortcuts
.