Crates.io | mpris-notifier |
lib.rs | mpris-notifier |
version | 0.1.10 |
source | src |
created_at | 2022-07-19 08:58:36.689534 |
updated_at | 2024-09-10 19:37:14.848494 |
description | Generates XDG desktop notifications for MPRIS status changes (track changes) |
homepage | |
repository | https://github.com/l1na-forever/mpris-notifier |
max_upload_size | |
id | 628196 |
size | 246,732 |
Simple version: Shows desktop notifications for media/music track changes.
Technical version: Dependency-light, highly-customizable, XDG desktop notification generator for 🎵 🎹 MPRIS media status changes 💿.
Screenshot of mpris-notifier (cfg) being displayed with mako (cfg)
mpris-notifier is particularly useful for when..
To install via Cargo:
cargo install mpris-notifier
To install from source, first, install Rust, and then run:
git clone github.com/l1na-forever/mpris-notifier
cd mpris-notifier
cargo install --path .
Binary releases can be found on the Releases page. To install a binary release, simply copy the executable to wherever's convenient (such as /usr/local/bin
, or ~/.local/bin
), and run it!
Typically, mpris-notifier is added to your desktop environment's start script (such as your ~/.xprofile
, or your window manager's configuration file). Add a line to run mpris-notifier
somewhere in the script:
mpris-notifier &
Upon first run, a configuration file with default values is generated at ~/.config/mpris-notifier/config.toml
. After customizing the configuration, restart mpris-notifier
:
pkill mpris-notifier; mpris-notifier &
Configuration keys are as follows:
subject_format
: Format string for the notification subject text.body_format
: Format string for the notification message text.join_string
: For fields including multiple entities (such as "artists"), this determines which character is used to join the strings.enable_album_art
: Enable album artwork fetch. When enabled, album artwork will appear alongside the album art, provided that the art fetch completes within the deadline.album_art_deadline
: The deadline, in milliseconds, before which the album art fetch must complete, else the notification will be sent without artwork.commands
: An optional list of commands that will be run when a notification is generated. Commands must be given as a list of command sequences, where the first item is the program, and the following items are the arguments (for example, [['~/script.sh', '--my-argument']]
).The following specifiers are available for subject_format
and body_format
:
{album}
{artist}
{title}
{track}
mpris-notifier fails to start
Make sure that the environment you're starting mpris-notifier
from has a session D-Bus available. You can verify this by running dbus-monitor
from the same context as with mpris-notifier
.
mpris-notifier doesn't emit notifications
First, verify that your notification daemon is working as expected by sending a notification from the same environment as mpris-notifier
:
notify-send test # or dunstify test
Next, verify that MPRIS player properties signals are being emitted. Monitor the session D-Bus for the MPRIS signal, ensure lines are logged as the track changes:
dbus-monitor | grep PlaybackStatus
If both above steps succeed but mpris-notifier isn't emitting notifications, please file an issue 🛠️ 🩹.
mpris-notifier
is mostly complete for my purposes, though I'll add small features as I need them. If there's an enhancement you'd like to see implemented (or would like to contribute 🥺), please file an issue.
Copyright © 2022 Lina
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 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.