Swayidle inhibitor that automatically detects audio / video and will prevent your system from sleeping. No manual intervention needed!
The main function of this project is to keep any sway based WM from going into an idle state when consuming media. Swaddle will monitor the dbus running daemon and based on values it sees in Playback Status
will correctly cause idling or inhibition.
dirs
: Config setupconfig
: Config buildingdbus
: Interfacing with the D-Bus.env_logger
: Better log handlingtoml
: For creating config fileserde
: To serialize toml
Swaddle can be installed from the AUR:
paru -S swaddle
-
Clone the repo and execute
just build_release
-
You can move the binary into your
$PATH
or run directly
To get some debugging logging from swaddle you can set the log level to debug and execute
just run_debug
To integrate swaddle with Sway/Hyprland, add the following line to your Sway/Hypr configuration:
- Sway:
# Swaddle configuration
exec_always --no-startup-id /usr/local/bin/swaddle &
- Hyprland:
# Swaddle configuration
exec = /usr/local/bin/swaddle &
Then reload your configuration or restart Sway/Hyprland.
The first time swaddle is run it will create a config file
under $HOME/.config/swaddle/config.toml
.
You can also create / overwrite the config with the following options
Name | Value | Explaination | Default |
---|---|---|---|
debug | boolean | should swaddle be run in debug mode | true |
server | table | includes the options to tweak how swaddle operates | |
server.inhibit_duration | integer | number of seconds to inhibit per cycle | 25 |
server.sleep_duration | integer | number of seconds to wait between cycles | 5 |