Ansible role to install and configure swayidle
Find a file
2023-04-16 22:43:38 +02:00
files First commit 2022-12-04 22:50:01 +01:00
meta First commit 2022-12-04 22:50:01 +01:00
tasks Service was not enabled on install 2023-04-16 22:43:38 +02:00
templates First commit 2022-12-04 22:50:01 +01:00
README.md First commit 2022-12-04 22:50:01 +01:00

Swayidle ansible role

Install and configure swayidle

Variables

This role only need one variable: swayidle_config. Here is an example :

swayidle_config:
  timeouts:
    - seconds: 300
      command: swaylock -f
    - seconds: 600
      command: swaymsg "output * dpms off" 
      resume: 'swaymsg "output * dpms on"'
  events:
    before-sleep: swaylock -f
    lock: swaylock -f

This variable contains two others: timeouts and events.

timeouts is an array of:

  • seconds: numbers of second to wait before trigger the event
  • command: command to execute when the event trigger
  • resume: command to execute when resume

events contains keys:values about others events. Key contains event name and value command to execute.

Please refer to man page for details: man 1 swayidle.

Licence

This script is released under le MIT licence

Copyright © 2022 Yorick Barbanneau

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.