Add defaults for all relevant host_vars
This commit is contained in:
parent
dba078af88
commit
7b837afa2d
4 changed files with 19 additions and 7 deletions
|
@ -4,10 +4,14 @@ set -eu
|
|||
|
||||
background() {
|
||||
swaybg \
|
||||
{% if (hostvars[ansible_hostname]['monitors'] | default([])) | length > 0 %}
|
||||
{% for monitor in hostvars[ansible_hostname]['monitors'] %}
|
||||
-o "{{ monitor['desc'] }}" -i ~/.config/background/{{ monitor['background']['file'] }} -m {{ monitor['background']['mode'] }} {%- if not loop.last %} \{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
-o '*' -i ~/.config/background/bg0.png -m fill
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
idle() {
|
||||
|
@ -25,10 +29,14 @@ lock() {
|
|||
exit 1
|
||||
else
|
||||
swaylock -f -e -s fill --indicator-radius 150 \
|
||||
{% if (hostvars[ansible_hostname]['monitors'] | default([])) | length > 0 %}
|
||||
{% for monitor in hostvars[ansible_hostname]['monitors'] %}
|
||||
-i {{ monitor['output'] }}:~/.config/background/lock-{{ monitor['background']['file'] }} {%- if not loop.last %} \{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
-i ~/.config/background/lock-bg0.png
|
||||
{% endif %}
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue