···77# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8899[dependencies]
1010-anyhow = "1.0.83"
1111-clap = { version = "4.5.4", features = ["derive"] }
1212-colog = "1.3.0"
1313-env_logger = "0.11.3"
1414-log = "0.4.21"
1010+anyhow = "1.0.99"
1111+clap = { version = "4.5.47", features = ["derive"] }
1212+colog = "1.4.0"
1313+env_logger = "0.11.8"
1414+log = "0.4.28"
1515mpris = "2.0.1"
1616-wayland-client = "0.31.2"
1717-wayland-protocols = { version = "0.32.6", features = ["client", "unstable"] }
1616+wayland-client = "0.31.11"
1717+wayland-protocols = { version = "0.32.9", features = ["client", "unstable"] }
18181919[profile.release]
2020panic = "abort"
+27-12
README.md
···11# wayland-mpris-idle-inhibit
2233-Uses the [idle-inhibit-unstable-v1](https://wayland.app/protocols/idle-inhibit-unstable-v1) Wayland protocol in order
44-to inhibit the idle behavior of the compositor when a media player is playing.
33+Uses the
44+[idle-inhibit-unstable-v1](https://wayland.app/protocols/idle-inhibit-unstable-v1)
55+Wayland protocol in order to inhibit the idle behavior of the compositor when a
66+media player is playing.
5768## Usage
7988-1. Add the flake to your flake inputs (other packaging formats just uh build it yourself idk)
1010+1. Add the flake to your flake inputs (other packaging formats just uh build it
1111+ yourself idk)
9122. Add the package to your environment.systemPackages
1010-3. Call the command, once you know which options you like best (see below), you can add it to your compositor's config.
1313+3. Call the command, once you know which options you like best (see below), you
1414+ can add it to your compositor's config.
11151216Ex for Hyprland:
1317···1519exec-once = "wayland-mpris-idle-inhibit"
1620```
17211818-Now whenever a player is playing media the program will inhibit the compositor's idle (e.g. hypridle), and will resume idle when the player is stopped or paused.
2222+Now whenever a player is playing media the program will inhibit the compositor's
2323+idle (e.g. hypridle), and will resume idle when the player is stopped or paused.
19242025### Note for KDE Connect
21262222-You probably still want your PC to fall asleep if your phone is playing media, so you can add these two options to the command call to make it ignore kdeconnect when scanning for active players:
2727+You probably still want your PC to fall asleep if your phone is playing media,
2828+so you can add these two options to the command call to make it ignore
2929+kdeconnect when scanning for active players:
23302431```
2532--ignore=kdeconnect --ignore=playerctld
2633```
27342828-The `playerctld` part is because for some reason playing media through kdeconnect registers *two* players, one with the right name and one with playerctld.
3535+The `playerctld` part is because for some reason playing media through
3636+kdeconnect registers _two_ players, one with the right name and one with
3737+playerctld.
29383039## Options
31403232-- `--poll-interval <interval>`: The interval in seconds at which the program will poll MPRIS for player information, default is `10`
4141+- `--poll-interval <interval>`: The interval in seconds at which the program
4242+ will poll MPRIS for player information, default is `10`
3343- `--ignore <name>`: A player name to ignore. This name is the part of the
3434- `org.mpris.MediaPlayer2` interface name after the `org.mpris.MediaPlayer2.` prefix. For example, for
3535- `org.mpris.MediaPlayer2.vlc`, the name is `vlc`. This option can be specified multiple times.
3636-- `--verbose`: Verbosity of output, can be 0 = silent, 1 = info, 2 = debug (defaults to 1)
4444+ `org.mpris.MediaPlayer2` interface name after the `org.mpris.MediaPlayer2.`
4545+ prefix. For example, for `org.mpris.MediaPlayer2.vlc`, the name is `vlc`. This
4646+ option can be specified multiple times.
4747+- `--verbose`: Verbosity of output, can be 0 = silent, 1 = info, 2 = debug
4848+ (defaults to 1)
3749- `--help`: Print help message
3850- `--version`: Print version information
39514052## Inspiration
41534242-This project was inspired by [wayland-pipewire-idle-inhibit](https://github.com/rafaelrc7/wayland-pipewire-idle-inhibit). Which does the same thing but for PipeWire audio streams. It is also a lot more feature rich than this project.
5454+This project was inspired by
5555+[wayland-pipewire-idle-inhibit](https://github.com/rafaelrc7/wayland-pipewire-idle-inhibit).
5656+Which does the same thing but for PipeWire audio streams. It is also a lot more
5757+feature rich than this project.