Change output template and variable

This commit is contained in:
Yorick Barbanneau 2022-11-19 23:59:04 +01:00
parent 3a4df1d28a
commit 9ce66100ab
2 changed files with 4 additions and 5 deletions

View file

@ -37,14 +37,13 @@ sway_outputs:
- id: 'all'
name: '*'
options:
- option: 'bg'
value: '/usr/share/backgrounds/sway/sway_wallpaper_blue_1920x1080.png fill'
bg: '/usr/share/backgrounds/sway/sway_wallpaper_blue_1920x1080.png fill'
``````
This example reproduce default beaviour:
* `id`: display id, useful for (future) kanshi configuration role
* `name`: name of display, this can be found with `swaymsg -t get_outputs`
* `options`: list of options
* `options`: list of options, format: `<option>: <value>`
### Input

View file

@ -2,8 +2,8 @@
{% for output in sway_outputs %}
{% if output.options is defined and ( output.status is not defined or output.status == 'enabled') %}
{%- for option in output.options %}
output {{ output.name ~ " " }} {{ option.option }} {{ option.value }}
{%- for option, value in output.options.items() %}
output {{ output.name ~ " " }} {{ option }} {{ value }}
{% endfor %}
{% endif %}