Tag: hellanzb
More conky tips (hellanzb and External IP)
04/09/2010
Sometimes I kinda get lost in the great conky rules that I and many people use..
For example look at this crunchbang conky forum.
a few snippets:
1 |
${execpi 3600 wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//';}|${addr eth0} |
Will give you your esternal and internal IP adress
Or for hellanzb:
1 2 3 4 5 6 7 |
${if_running hellanzb}${font terminus:bold:size=11}${color FFFFFF}NZB ${hr 2}${color 888888} ${execi 10 ~/.conky/hellaconky.py -n} Speed: ${execi 10 ~/.conky/hellaconky.py -r} k/s Percent Done: ${execi 10 ~/.conky/hellaconky.py -p}% ETA:${execi 10 ~/.conky/hellaconky.py -e} Queued: ${execi 10 ~/.conky/hellaconky.py -q} ${endif} |
The hellaconly.py looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
#!/usr/bin/python # writen by Austin Trask # contact austin@arcintel.com # visit http://wiki.arcintel.com for more info import xmlrpclib import optparse #change this next line to represent your hellanzb server info SERVER = 'http://hellanzb:changeme@localhost:8760/' hellanzbServer = xmlrpclib.ServerProxy(SERVER) def NZB(option, opt, value, parser): download = hellanzbServer.status()['currently_downloading'] if( len(download)>0): print download[0]['nzbName'].encode('ascii', 'ignore') else: print 'None'> def rate(option, opt, value, parser): rate = int(hellanzbServer.status()['rate']) print rate def percentage(option, opt, value, parse): percent = hellanzbServer.status()['percent_complete'] print percent def ETA(option, opt, value, parse): eta = hellanzbServer.status()['eta'] hours = (eta/3600) minutes = (eta/60)%60 seconds = (eta%60) time_left = "%02d:%02d:%02d" % (hours, minutes, seconds) print time_left parser = optparse.OptionParser() parser.add_option("-n", "--nzb", action="callback", callback=NZB, help="output current NZB") parser.add_option("-r", "--rate", action="callback", callback=rate, help="output hellanzb rate") parser.add_option("-p", "--percent", action="callback", callback=percentage, help="output completion percentage of current NZB") parser.add_option("-e", "--eta", action="callback", callback=ETA, help="displays the ETA of the current NZB") # New function definitions added by ubuntuforums user "kebes" # to allow for query of the queue: def NZBNext(option, opt, value, parser): queued = hellanzbServer.status()['queued'] if( len(queued)>0): print queued[0]['nzbName'].encode('ascii', 'ignore') else: print 'None' def QueueLength(option, opt, value, parser): queued = hellanzbServer.status()['queued'] print len(queued) def ListQueued(option, opt, value, parser): queued = hellanzbServer.status()['queued'] if( len(queued)>0): for item in queued: print item['nzbName'].encode('ascii', 'ignore') else: print 'None' parser.add_option("-N", "--next", action="callback", callback=NZBNext, help="output next NZB") parser.add_option("-l", "--length", action="callback", callback=QueueLength, help="output queue length") parser.add_option("-q", "--list", action="callback", callback=ListQueued, help="output all items in queue") (options, args) = parser.parse_args() |
Share the post "More conky tips (hellanzb and External IP)"