https://github.com/sunny/anyplayer
Interact with the currently running music player. Supports iTunes Mac, iTunes Windows, Spotify Mac, Rdio Mac, MPD, Rhythmbox, Amarok and XMMS2.
https://github.com/sunny/anyplayer
amarok itunes-windows mpd music music-console music-player rhythmbox ruby spotify-mac xmms2
Last synced: 9 months ago
JSON representation
Interact with the currently running music player. Supports iTunes Mac, iTunes Windows, Spotify Mac, Rdio Mac, MPD, Rhythmbox, Amarok and XMMS2.
- Host: GitHub
- URL: https://github.com/sunny/anyplayer
- Owner: sunny
- License: mit
- Created: 2011-01-18T00:32:10.000Z (about 15 years ago)
- Default Branch: main
- Last Pushed: 2022-08-02T11:43:37.000Z (over 3 years ago)
- Last Synced: 2025-05-28T12:48:28.134Z (9 months ago)
- Topics: amarok, itunes-windows, mpd, music, music-console, music-player, rhythmbox, ruby, spotify-mac, xmms2
- Language: Ruby
- Homepage:
- Size: 88.9 KB
- Stars: 50
- Watchers: 4
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
Anyplayer
=========
[](http://badge.fury.io/rb/anyplayer)
[](https://travis-ci.org/sunny/anyplayer)
Interacts with the currently running music player.
Supports iTunes Mac, iTunes Windows, Spotify Mac, Rdio Mac, MPD, Rhythmbox, Amarok and XMMS2.
Install
-------
```sh
$ gem install anyplayer
```
Use it in your terminal
-----------------------
```sh
$ 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:
```rb
# Interact with the current music player
gem "anyplayer"
```
In your code:
```ruby
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](https://github.com/sunny/so-nice/) Web interface:

Contribute!
-----------
All contributions are welcome! Head to the [Github issues](https://github.com/sunny/anyplayer/issues) to report bugs, questions or code. Also, check out `CONTRIBUTING.md`.
Here a few useful commands while developping:
```sh
$ 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