Giter Club home page Giter Club logo

mpd-notification's Introduction

mpd-notification

Notify about tracks played by mpd

This runs in background and produces notifications whenever mpd produces an event, that is new track is played or playback is paused or stopped. Notifications look like this:

Notification

This now even supports album artwork:

Notification with Artwork

Read below for the details.

Requirements

To compile and run mpd-notification you need:

To use mpd-notification you probably want mpd, the music player daemon itself. ;)

Some systems may require additional development packages for the libraries. Look for libnotify-devel, libmpdclient-devel or similar.

Build and install

Building and installing is very easy. Just run:

make

followed by:

make install

This will place an executable at /usr/bin/mpd-notification, documentation can be found in /usr/share/doc/mpd-notification/. Additionally a systemd unit file is installed to /usr/lib/systemd/user/.

Usage

Just run mpd-notification to run it once. A systemd user service can be started and/or enabled with systemctl --user start mpd-notification or systemctl --user enable mpd-notification.

mpd-notification accepts some arguments:

  • -h: show help
  • -H HOST: connect to HOST
  • -m MUSIC-DIR: use MUSIC-DIR for artwork lookup
  • --notification-file-workaround: write artwork to file for notification daemons that do required it
  • -o: Notification text is one line (no line breaks)
  • -x: eXtra new lines in-between
  • -p PORT: connect to PORT
  • -s PIXELS: scale image to a maximum size PIXELS x PIXELS pixels, keeping ratio
  • -t TIMEOUT: notification timeout, TIMEOUT in seconds
  • -v: verbose output
  • -V: print version information

Configuration

Configuration options can be read from a configuration file. mpd tries to read ${XDG_CONFIG_HOME}/mpd-notification.conf, then ~/.config/mpd-notification.conf, which is expected to look like this:

host = localhost
port = 6600
music-dir = /srv/media/music/
oneline = true
scale = 200
timeout = 20
xtra-height = false

Unused options can be commented or removed completely.

Artwork

mpd does not provide any information where it finds its music files. To make mpd-notification display album artwork you need to tell it where to look for artwork. You can do that by exporting XDG_MUSIC_DIR to your environment, by specifying -m or --music-dir on the command line or by setting music-dir in configuration file. mpd-notification reads album artwork from mp3 files, otherwise an image file containing the artwork needs to be placed in the same directory as the media file and named cover.jpg, cover.png, folder.jpg or folder.png.

Upstream

URL: GitHub.com

Mirror: eworm.de GitLab.com

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.