From XMMS2
Jump to: navigation, search
There is no image of this client - please upload one!
AuthorDaniel Waber
Latest version0.1
Development languageRuby
User interfaceConsole
Screenshots[1] [2]

x2c is a small, interactive ruby command line client for xmms2


A small, interactive ruby command line client for xmms2

the client itself is an irb shell executing commands on the client object, which has been extended to get a powerful and easy interface to playback, playlists and collections. As it is all ruby, you can easily extend its functionality, create new aliases or functions, or create you own client on top of it.


Features for non-rubyists, the basics

  • usable without knowing ruby
  • works an almost all terminal
  • nice command-line interface with completion
  • module support for new features
  • already has cool module: vote, mlib, autodaemon, ...
  • short tutorial to get into the feeling of the client
  • help system, so you don't get lost ;)

Features for rubyists, advanced things

  • cool stack feature
  • highly configurable and extensible
  • easy to modify for your own needs
  • you can do cool things, as all is ruby

Getting started

You can download x2c at Rubyforge(tgzgem) or get the latest snaps at my hompage.

Simply extract the tar, move the x2c folder where you like it and run ./x2c or create a symlink to x2c. You also can use the gem to install x2c:

 sudo gem install x2c-0.1.gem

Everything else should be straightforward, because of the help and tutorial features :)

Code snippets

skip sid

   # little script you can call in post_deamon to make sids only play for 3m
   def start_sid_skip
       skipsid = nil
       @sidskip = broadcast_playback_current_id.notifier do |r|
           if skipsid
               skipsid = nil
           song =
           skipsid = do
               if song.chain =~ /sid/ && ![:duration]
                   sleep 180
                   print "\r...  skipping sid"
       puts "...  sidskip started"
   def stop_sid_skip
       puts "...  stopping sidskip"

the mlib

  # remove unwanted media
  (url =~ 'file:///some/stage/music%').list.each{|id| medialib_entry_remove(id)}
  # tag media
  (url =~ 'anArtist/%').list.each do |s|
    if s.url =~ /\/(\w| )*\/(\w*) - (\w*)/
      s.artist= $2
      s.album = $1
      s.title = $3

Volume fades

  (0...100).each{|i| volume i; sleep 0.1}
  (0...100).each{|i| volume 100-i; sleep 0.1}