README: Document custom themes
This commit is contained in:
@@ -79,17 +79,45 @@ app that triggered it crashes.
|
||||
|
||||
## Feedback theme
|
||||
Events are then mapped to a specific type of feedback (sound, led, vibra) via a
|
||||
device specific theme (since devices have different capabilities).
|
||||
device specific theme - since devices have different capabilities and
|
||||
different users different needs.
|
||||
|
||||
Feedbackd is shipped with a default theme `default.json`.
|
||||
You can add your own themes in one of two ways:
|
||||
You can add your own themes in multiple ways:
|
||||
|
||||
1. By exporting an environment variable `FEEDBACK_THEME` with a path to a
|
||||
valid theme file (not recommended, use for testing only), or
|
||||
2. By creating a theme file under `$XDG_CONFIG_HOME/feedbackd/themes/default.json`.
|
||||
If `XDG_CONFIG_HOME` environment variable is not set or empty, it will
|
||||
default to `$HOME/.config`, or
|
||||
3. By adding your theme file to one of the folders in the `XDG_DATA_DIRS`
|
||||
3. By creating a theme file under `$XDG_CONFIG_HOME/feedbackd/themes/custom.json`.
|
||||
You only specify the values you want to change in that theme and add an entry
|
||||
```json
|
||||
{
|
||||
"name: "custom"
|
||||
"parent-theme": "default"
|
||||
"profiles" : [
|
||||
...(entries you want to change go here)...
|
||||
]
|
||||
}
|
||||
```
|
||||
next to the `name` entry in. This has the upside that your theme
|
||||
gets way smaller and that new entries added to the default theme
|
||||
will automatically be used by your theme too. See
|
||||
[here](./tests/data/user-config/feedbackd/themes/custom.json) for
|
||||
an example. Once you have the file in place, tell feedbackd the
|
||||
them you want to use:
|
||||
|
||||
gsettings set org.sigxcpu.feedbackd theme custom
|
||||
|
||||
When you want to go back to the default theme just do:
|
||||
|
||||
gsettings reset org.sigxcpu.feedbackd theme
|
||||
|
||||
Note that you can name your theme as you wish but avoid theme names
|
||||
starting with `__` or `$` as this namespace is reserved.
|
||||
|
||||
4. By adding your theme file to one of the folders in the `XDG_DATA_DIRS`
|
||||
environment variable, appended with `feedbackd/themes/`. This folder isn't
|
||||
created automatically, so you have to create it yourself. Here's an example:
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user