All pastes #61444 Raw Edit

Someone

public text v1 · immutable
#61444 ·published 2006-06-03 21:30 UTC
rendered paste body
#!/usr/bin/env ruby

require 'mpd'

m = MPD.new

if m.strf("%A") > "0"
  npSong = m.strf("%a - %t (from %A) [%e/%l]")
else
  npSong = m.strf("%a - %t [%e/%l]")
end

if m.status["state"] == "play"
  npEcho = "np: #{npSong}"
elsif m.status["state"] == "pause"
  npEcho = "np: #{npSong} PAUSED"
else
  npEcho = "np: nothing"
end

puts npEcho