# {{ ansible_managed }} {% if swayidle_config is defined %} {% if swayidle_config['timeouts'] is defined %} {% for timeout in swayidle_config['timeouts'] %} timeout {{ timeout['seconds'] }} '{{ timeout['command'] }}' {%- if timeout['resume'] is defined %} {{ ' resume' }} '{{ timeout['resume'] }}' {% endif %} {% endfor %} {% endif %} {% if swayidle_config['events'] is defined %} {% for event, command in swayidle_config['events'].items() %} {{ event }} '{{ command }}' {% endfor %} {% endif %} {% endif %}