https://github.com/attron/swaddle
Swayidle inhibitor when watching content or listening to audio
https://github.com/attron/swaddle
hyprland inhibitors sway swayidle swaylock
Last synced: over 1 year ago
JSON representation
Swayidle inhibitor when watching content or listening to audio
- Host: GitHub
- URL: https://github.com/attron/swaddle
- Owner: ATTron
- Created: 2023-11-15T06:36:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-26T21:53:59.000Z (over 1 year ago)
- Last Synced: 2024-10-27T14:22:23.055Z (over 1 year ago)
- Topics: hyprland, inhibitors, sway, swayidle, swaylock
- Language: Rust
- Homepage:
- Size: 18.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swaddle
Swayidle inhibitor that automatically detects audio / video and will prevent your system from sleeping. No manual intervention needed!
## Overview
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.
## Dependencies
* `dirs`: Config setup
* `config`: Config building
* `dbus`: Interfacing with the D-Bus.
* `env_logger`: Better log handling
* `toml`: For creating config file
* `serde`: To serialize toml
## Installation
Swaddle can be installed from the AUR:
```bash
paru -S swaddle
```
### Building from source
* Clone the repo and execute
```bash
just build_release
```
* You can move the binary into your `$PATH` or run directly
#### Debugging
To get some debugging logging from swaddle you can set the log level to debug and execute
```bash
just run_debug
```
## Post-Install
To integrate swaddle with Sway/Hyprland, add the following line to your Sway/Hypr configuration:
* Sway:
```conf
# Swaddle configuration
exec_always --no-startup-id /usr/local/bin/swaddle &
```
* Hyprland:
```conf
# Swaddle configuration
exec = /usr/local/bin/swaddle &
```
Then reload your configuration or restart Sway/Hyprland.
### Configuration File (Optional)
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|
---