All pastes #269951 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-12-06 23:13 UTC
rendered paste body
at
import commands

def     mpd_info_full(word, word_eol, userdata):

# Title full #
        volume = commands.getoutput("mpc volume | sed 's/://g' | sed 's/v/V/g' | sed 's/%/ %/g' | sed 's/e1/e 1/g' | cut -c -11")
        notitle = commands.getoutput("mpc | wc -l")
        timetot = commands.getoutput("mpc --format '[%time%]' | head -n1")
        timeof = commands.getoutput("mpc | grep playing | tr ' ' '\012' | grep :")
        url = commands.getoutput("mpc --format '%file%' | head -n1")
        stream = commands.getoutput("mpc --format '%file%' | grep http:// | wc -l")
        streamtitle = commands.getoutput("mpc --format  '[%title% (%name%)]' | head -n 1")
        bitrate = commands.getoutput("echo -e 'status\nclose' | nc localhost 6600 | grep bitrate | sed 's/bitrate: //;'")
        title = commands.getoutput("mpc --format  '[%artist% - %album% - %title%]' | head -n 1 | sed 's/ - $//;s/^ - //'")
        if notitle == "1": xchat.command("me is listening to -=(\002 defintiv nothing\002 )=-")
        else:
                if stream == "1":xchat.command("me is listening to -=(\002 %s - %s - %s\002 at %s\002 )=-" % (streamtitle, url, volume, bitrate))
                else: title = xchat.command("me    \00324*    \00319M\00320E\00319R\00320R\00319Y\00320 C\00319H\00320R\00319I\00320S\00319T\00320M\00319A\00320S\00319!\n\00327   / \    \003oorza is listening to\n\00327  /   \   \003 %s \n\00327  /   \   \003 %s of %s\n\00327 /     \  \003 %s kbps\n\00323   | |" % (title, timeof, timetot, bitrate))

        return xchat.EAT_ALL