Posts tagged ·

conky

·...

Conky animation with images..

no comments

I was playing arround with conky and wanted to show a animation..

So I took a .gif and used this line to grap all stills from it:


gifsicle --unoptimize --explode /home/pieter/temp/foo.gif --output /home/pieter/temp/explode/temp.gif

Then I used this conky config to show it:


imlib_cache_size 0
template1 /home/pieter/temp/temp.gif.
template2 -p 10,20 -s 135x135

TEXT
Conky Animation with images
${if_updatenr 01}${image ${template1}005 ${template2}}${endif}
${if_updatenr 02}${image ${template1}010 ${template2}}${endif}
${if_updatenr 03}${image ${template1}015 ${template2}}${endif}
${if_updatenr 04}${image ${template1}020 ${template2}}${endif}
${if_updatenr 05}${image ${template1}025 ${template2}}${endif}
${if_updatenr 06}${image ${template1}030 ${template2}}${endif}
${if_updatenr 07}${image ${template1}035 ${template2}}${endif}
${if_updatenr 08}${image ${template1}040 ${template2}}${endif}
${if_updatenr 09}${image ${template1}045 ${template2}}${endif}
${if_updatenr 10}${image ${template1}050 ${template2}}${endif}
${if_updatenr 11}${image ${template1}055 ${template2}}${endif}
${if_updatenr 12}${image ${template1}060 ${template2}}${endif}
${if_updatenr 13}${image ${template1}065 ${template2}}${endif}
${if_updatenr 14}${image ${template1}070 ${template2}}${endif}
${if_updatenr 15}${image ${template1}075 ${template2}}${endif}
${if_updatenr 16}${image ${template1}080 ${template2}}${endif}
${if_updatenr 17}${image ${template1}085 ${template2}}${endif}
${if_updatenr 18}${image ${template1}090 ${template2}}${endif}
${if_updatenr 19}${image ${template1}095 ${template2}}${endif}
${if_updatenr 20}${image ${template1}100 ${template2}}${endif}
${if_updatenr 21}${image ${template1}105 ${template2}}${endif}
${if_updatenr 22}${image ${template1}110 ${template2}}${endif}
${if_updatenr 23}${image ${template1}115 ${template2}}${endif}
${if_updatenr 24}${image ${template1}120 ${template2}}${endif}
${if_updatenr 25}${image ${template1}125 ${template2}}${endif}
${if_updatenr 26}${image ${template1}130 ${template2}}${endif}
${if_updatenr 27}${image ${template1}135 ${template2}}${endif}
${if_updatenr 28}${image ${template1}140 ${template2}}${endif}
${if_updatenr 29}${image ${template1}145 ${template2}}${endif}
${if_updatenr 30}${image ${template1}150 ${template2}}${endif}
${if_updatenr 31}${image ${template1}155 ${template2}}${endif}
${if_updatenr 32}${image ${template1}160 ${template2}}${endif}
${if_updatenr 33}${image ${template1}165 ${template2}}${endif}
${if_updatenr 34}${image ${template1}170 ${template2}}${endif}
${if_updatenr 35}${image ${template1}175 ${template2}}${endif}
${if_updatenr 36}${image ${template1}180 ${template2}}${endif}
${if_updatenr 37}${image ${template1}185 ${template2}}${endif}
${if_updatenr 38}${image ${template1}190 ${template2}}${endif}
${if_updatenr 39}${image ${template1}195 ${template2}}${endif}
${if_updatenr 40}${image ${template1}200 ${template2}}${endif}
${if_updatenr 41}${image ${template1}205 ${template2}}${endif}
${if_updatenr 42}${image ${template1}210 ${template2}}${endif}
${if_updatenr 43}${image ${template1}215 ${template2}}${endif}
${if_updatenr 44}${image ${template1}220 ${template2}}${endif}
${if_updatenr 45}${image ${template1}225 ${template2}}${endif}
${if_updatenr 46}${image ${template1}230 ${template2}}${endif}
${if_updatenr 47}${image ${template1}235 ${template2}}${endif}
${if_updatenr 48}${image ${template1}239 ${template2}}${endif}
${if_updatenr 49}${image ${template1}239 ${template2}}${endif}
${if_updatenr 50}${image ${template1}239 ${template2}}${endif}

As you see it isnt that optimized at all (although I used templates vars to make it easy for myself).

You can see it at work in this movie: conky animation with images

buienradar (weather image) in conky

no comments

Erik wanted some help with getting a piece of an animated gif to show up in his conky (Conky Help::Tips, Tricks & Scripts::CrunchBang Forums.)

Now I liked that idea very much so came up with this:

First I created a directory ~/.conky/radar/  (for the temp.gif).
Then the knmiradar.sh: (chmod it +x)


#!/bin/bash
#
# Erik
# 2010-07-31
# iggikoopa and pieter
# adjust the paths to your own liking!
#

# Enter the name of the radar GIF image you want to download:
RADARIMAGEURL="http://www.knmi.nl/neerslagradar/images/meest_recente_radarloop451.gif"
RADARIMAGE="meest_recente_radarloop451.gif"

# Download the GIF file:
wget -q -N -t 1 "$RADARIMAGEURL" # quiet, timestamping, 1 retry

# Split the file, leave only the last frame. This might be tricky, because the
# frames seem to share one background frame...

# convert the gif to the right colors so we can do something with it.
gifsicle --colors=255 "$RADARIMAGE" > /home/pieter/.conky/radar/temp.gif
# make them B&W (I like it that way)
gifsicle --use-col=bw /home/pieter/.conky/radar/temp.gif > /home/pieter/.conky/radar/tempbw.gif
# For greyscale:
# gifsicle --dither --use-col=bw /home/pieter/.conky/radar/temp.gif > /home/pieter/.conky/radar/tempbw.gif
# grab the last animated gif and make a stilt image of it.
gifsicle -U /home/pieter/.conky/radar/tempbw.gif "#-1" > /home/pieter/.conky/radar/radar.gif

# if you want to keep the colors then comment above and uncomment these:
#gifsicle --colors=255 "$RADARIMAGE" > /home/pieter/.conky/radar/temp.gif
#gifsicle -U /home/pieter/.conky/radar/temp.gif "#-1" > /home/pieter/.conky/radar/radar.gif

Then in Conky:
add variable:
imlib_cache_size 0

and use this (dont forget to edit the path):


${texeci 300 /home/pieter/.conky/knmiradar.sh}
${image /home/pieter/.conky/radar/radar.gif -p 50,15 -s 125x125}

Works great here…

Show album art in Conky with python script.

no comments

I wanted to show some Album art in conky.

Ofcourse i didnt need to re-invent the wheel so I stumbled upon this forum topic:

Crunchbanglinux::forums::images-in-conky-specifically-rhythmbox-album-art

iggykoopa created a nice script (see here) but because I like the dark feeling of #! I wanted to have the album art in greyscale.

I took his base from: http://crunchbanglinux.org/pastebin/29 and added this part to it: (and an option so you can start it with “conkymusic.py -g”.)

def grey:
image = Image.openhome + "/.album"
image = image.convert'L'
image.savehome + "/.album", "png"

You can grab the whole code here: Python CrunchBang Linux Pastebin.

The code in conky:

${execi 10 /home/pieter/.conky/conkymusic.py -g -s 75x75}
${image /home/pieter/.album -p 170,10 -s 75x75}

Works great here.

Display a # in conky

no comments

I wanted to display #! in my conky script but could not seem to get it working right.

This tip: Conky Help – Tips, Tricks & Scripts – CrunchBang Linux Forums worked great!

To display a “#” in conky you have to do

${exec echo “#”}

More conky tips (hellanzb and External IP)

no comments

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:
${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:
${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:
#!/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()

Newsbeuter and Google Reader

no comments

I love those apps that work from a shell in linux.

One of my favs is Newsbeuter.

To make it work with Google Reader you need to create config file in:

.newsbeuter/config

In that file add these lines:

urls-source “googlereader”

googlereader-login “USERNAME@gmail.com”

googlereader-password “PASSWORD”

My config so far:

urls-source “googlereader”
googlereader-login “USERNAME@gmail.com”
googlereader-password “PASWORD”
googlereader-show-special-feeds yes
show-read-feeds  no
refresh-on-startup yes
notify-beep yes
notify-xterm yes
auto-reload yes
reload-time 120

To make it show up in Conky I added this to the config:

News:${alignr}${execpi 600 newsbeuter -x reload print-unread}

Conky examples

no comments

This guy has some great examples for the conky script:

The Peachy Blog: Index. Start Here!.

!# crunchbang

no comments

So I was really happy with sabayon running on my machines but somehow I didnt get that linux feeling (or kinda lost it).

So I searched furter and stumbled on cruchnbang.

crunchbang

You need to change loads of stuff but thatsthe great thing about this distro.

There is a great community behind crunchbang and they have some amazing suggestions, tips, hints and solutions for you.

Like this conky script I am running on it instead of the default one.