#!/usr/bin/env ruby # # Copyright 2007 David Shakaryan # Distributed under the terms of the GNU General Public License v2. require 'mpd' mpd = MPD.new str = 'np: %a - %t [%e/%l]' case mpd.status['state'] when 'play' puts mpd.strf(str) when 'pause' puts mpd.strf(str) + ' [PAUSED]' else puts 'np: nothing' end