Git Product home page Git Product logo

mpris-notifier's Introduction

mpris-notifier

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 being displayed with mako

Screenshot of mpris-notifier (cfg) being displayed with mako (cfg)

Features:

mpris-notifier is particularly useful for when..

  • .. you run a headless music client, or a music client that doesn't natively emit desktop notifications (works great with spotifyd!)
  • .. you often switch between music clients, or run multiple music clients at once, and want consistent notifications without extra configuration (the same way sxhkd lets you reuse a hotkey configuration among multiple DEs)

Installation

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!

Usage

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.

Troubleshooting

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 πŸ› οΈ 🩹.

Status

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.

Licence

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.

mpris-notifier's People

Contributors

l1na-forever avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.