Prevents your system from idling/suspending while media is being played.
dbussystemd
cargo install partymodepartymode [OPTIONS] <COMMAND>
Commands:
daemon Run the partymode daemon
on Enable party mode
off Disable party mode
toggle Toggle party mode
status Show the current status
help Print this message or the help of the given subcommand(s)
Options:
-c, --config <PATH> Provide a custom location for the config file
-v, --verbose Enable verbose logging
-h, --help Print help
-V, --version Print version
To manage the partymode daemon with systemd, you can create this user service:
[Unit]
After=dbus-broker.service
Description="partymode - Keep your system awake while playing media"
Documentation="https://github.com/peppidesu/partymode"
[Service]
Type=simple
ExecStart=/path/to/partymode daemon # change this
Restart=on-failure
[Install]
WantedBy=default.targetpartymode will create the following config at ~/.config/partymode/config.toml (or the directory specified with -c) if it doesn't exist:
default-enabled = true
poll-interval = 5000
["*"]
always = false
mode = "block"
targets = ["idle"]Whether to enable partymode on startup or not.
How often to check for player changes, in ms.
Rules allow you to specify inhibit behavior on a per-application basis. A rule looks like this:
[name]
always = false
mode = "<mode>"
targets = []When true, inhibit regardless of whether partymode is enabled or not.
Inhibit mode as specified by systemd-inhibit(1).
What to inhibit. Can be one of "idle", "suspend" or "shutdown".
partymode will use the last part of the MPRIS bus name (org.mpris.MediaPlayer2.<name>) to match against config rules. You can get a list of these with playerctl:
playerctl -lIf parts of a rule are omitted or no matching rule is found, partymode resorts to using the default rule (["*"]).
partymode is different from most inhibit tools like caffeine-ng or the built-in KDE menu, because they don't automatically inhibit when media is playing. These tools aim to solve a different problem.
To give an example, partymode will allow you to inhibit suspend while listening to music, regardless of whether that window is fullscreen or not. When you stop playback, partymode will also stop inhibiting.
partymode being enabled doesn't mean it will force inhibit, it only means it will apply the rules defined in the configuration.
Feel free to report issues and PR :)