Home

Awesome

Anyplayer

Gem Version Build Status

Interacts with the currently running music player. Supports iTunes Mac, iTunes Windows, Spotify Mac, Rdio Mac, MPD, Rhythmbox, Amarok and XMMS2.

Install

$ gem install anyplayer

Use it in your terminal

$ anyplayer artist     # artist of the current track
New Order
$ anyplayer track      # name of the current track
Blue Monday
$ anyplayer album
Power, Corruption & Lies
$ anyplayer next       # changes track forward
$ anyplayer prev       #               backward
$ anyplayer playpause  # pauses if it is playing, plays if it's paused
$ anyplayer play
$ anyplayer pause
$ anyplayer voldown    # put the volume somewhat up
$ anyplayer volup      #                         down
$ anyplayer volume     # prints the volume percentage
100
$ anyplayer vote       # votes to go to next song (default number of votes is 5)
$ anyplayer name
iTunes
$ anyplayer launched && echo "a player is running" || echo "nothing running"
a player is running

Or in Ruby

In your Gemfile:

# Interact with the current music player
gem "anyplayer"

In your code:

require "anyplayer"
player = Anyplayer::Selector.new.player

player.launched? # => true
player.name # => Rythmbox
player.artist # => "The Avalanches"
player.track # => "Frontier Psychiatrist"
# …

Or in a browser

With the So Nice Web interface:

So Nice Screenshot

Contribute!

All contributions are welcome! Head to the Github issues to report bugs, questions or code. Also, check out CONTRIBUTING.md.

Here a few useful commands while developping:

$ ruby -Ilib bin/anyplayer  # Use the anyplayer command-line from source
$ bin/rake test             # Launch tests
$ bin/rake install          # Install from source
$ bin/rake console          # Launch console

License

MIT