Code Monkey home page Code Monkey logo

cmusfm's Introduction

cmusfm Build Status

Last.fm standalone scrobbler for the cmus music player.

Features:

  • Listening now notification support
  • Off-line played track cache for later submission
  • POSIX ERE-based file name parser
  • Desktop notification support (optionally)
  • Customizable scrobbling service
  • Small memory footprint

When discography is correctly tagged - at least artist and title field - scrobbling needs no further configuration (see: Configuration). However, if this requirement is not met, then one can use POSIX ERE-based file name parser feature. But what the heck is this?

Cmusfm allows to configure regular expression patterns for local files and for shoutcast streaming services. The syntax is compatible with the POSIX Extended Regular Expression (ERE) with one exception. Matched subexpression has to be marked with the ? extension notation. There are four distinguish types:

  • (?A...) - match artist name
  • (?B...) - match album name
  • (?N...) - match track number
  • (?T...) - match track title

All extension types can be used only once, otherwise only the first occurrence will be used. Also note, that using matched subexpressions without the extension notation might result in an unexpected behavior. Default configuration assumes formats as follows:

  • format-localfile = "^(?A.+) - (?T.+)\.[^.]+$" (matches: The Beatles - Yellow Submarine.ogg)
  • format-shoutcast = "^(?A.+) - (?T.+)$" (matches: The Beatles - Yellow Submarine)

Scrobbling behavior and now playing notification can be controlled via the following self-explainable options (default is "yes" for all of them):

  • now-playing-localfile = "yes"
  • now-playing-shoutcast = "no"
  • submit-localfile = "yes"
  • submit-shoutcast = "no"

Cmusfm provides also one extra feature, which was mentioned earlier - desktop notifications. In order to have this functionality, one has to enable it during the compilation stage. Since it is an extra feature, it is disabled by default in the cmusfm configuration file too. Note, that cover art file has to be explicitly stored in the current track's directory - embedded covers are not displayed. Exemplary configuration might be as follows:

  • notification = "yes"
  • format-coverfile = "^(cover|folder)\.jpg$"

By default cmusfm scrobbles to the Last.fm service. However, it is possible to change this behavior by modifying service-api-url and service-auth-url options in the configuration file. Afterwards, one should reinitialize cmusfm (cmusfm init) in order to authenticate with new scrobbling service. In order to use Libre.fm as a scrobbling service, one shall use configuration as follows:

  • service-api-url = "https://libre.fm/2.0/"
  • service-auth-url = "https://libre.fm/api/auth"

Installation

$ autoreconf --install
$ mkdir build && cd build
$ ../configure --enable-libnotify
$ make && make install

Configuration

Before usage with the cmus music player, one has to grant access for the cmusfm in the Last.fm service. To do so, simply run cmusfm with the init argument and follow the instruction. This action might be also required when upgrading to the newer version with new features.

$ cmusfm init

After that you can safely edit ~/.config/cmus/cmusfm.conf configuration file.

Note, that for some changes to take place, restart of the cmusfm server process is required. To achieved this, one has to quit cmus player and then kill background instance of cmusfm (e.g. pkill cmusfm). Above statement is not valid if one's got inotify subsystem available.

As a final step (after the access is granted in the Last.fm service) one should set cmusfm as a status display program for cmus. This can be done by starting cmus and typing in the main window:

:set status_display_program=cmusfm

Enjoy!

cmusfm's People

Contributors

arkamar avatar arkq avatar

Stargazers

 avatar

Watchers

 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.