Tag: linux
buienradar (weather image) in conky
05/09/2010
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)
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 |
#!/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:
1 |
imlib_cache_size 0 |
and use this (dont forget to edit the path):
1 2 |
${texeci 300 /home/pieter/.conky/knmiradar.sh} ${image /home/pieter/.conky/radar/radar.gif -p 50,15 -s 125x125} |
Works great here…
Share the post "buienradar (weather image) in conky"
Display a # in conky
04/09/2010
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 “#”}
Share the post "Display a # in conky"
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)"
Screen cheat list
30/08/2010
Found this cheatlist somewhere…
Credits to the one who uploaded it ..
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 |
+-------------------------------------------------------------------------------------------------+ | The formatting here is simple enough to understand (I would hope). ^ means ctrl+, so ^x is | | ctrl+x. M- means meta (generally left-alt or escape)+, so M-x is left-alt+x | |-------------------------------------------------------------------------------------------------| | Action | tmux | screen | |----------------------------------------------+-------------------------------+------------------| | | tmux OR | | | start a new session | tmux new OR | screen | |----------------------------------------------+-------------------------------+------------------| | re-attach a detached session | tmux attach OR | screen -r | | | tmux new-session | | | | tmux attach-session | | |----------------------------------------------+-------------------------------+------------------| | re-attach an attached session (detaching it | tmux attach -d OR | screen -dr | | from elsewhere) | tmux attach-session -d | | |----------------------------------------------+-------------------------------+------------------| | re-attach an attached session (keeping it | tmux attach OR | screen -x | | attached elsewhere) | tmux attach-session | | |----------------------------------------------+-------------------------------+------------------| | detach from currently attached session | ^b d OR | ^a ^d OR | | | ^b :detach | ^a :detach | |----------------------------------------------+-------------------------------+------------------| | rename-window to newname | ^b , <newname> OR | ^a A <newname> | | | ^b :rename-window <newname> | | |----------------------------------------------+-------------------------------+------------------| | list windows | ^b w | ^a w | |----------------------------------------------+-------------------------------+------------------| | list windows in chooseable menu | | ^a " | |----------------------------------------------+-------------------------------+------------------| | go to window # | ^b # | ^a # | |----------------------------------------------+-------------------------------+------------------| | go to last-active window | ^b l | ^a l | |----------------------------------------------+-------------------------------+------------------| | go to next window | ^b n | ^a n | |----------------------------------------------+-------------------------------+------------------| | go to previous window | ^b p | ^a p | |----------------------------------------------+-------------------------------+------------------| | see keybindings | ^b ? | ^a ? | |----------------------------------------------+-------------------------------+------------------| | | ^b s OR | | | list sessions | tmux ls OR | screen -ls | | | tmux list-sessions | | |----------------------------------------------+-------------------------------+------------------| | toggle visual bell | | ^a ^g | |----------------------------------------------+-------------------------------+------------------| | create another shell | ^b c | ^a c | |----------------------------------------------+-------------------------------+------------------| | exit current shell | ^d | ^d | |----------------------------------------------+-------------------------------+------------------| | split pane horizontally | ^b " | | |----------------------------------------------+-------------------------------+------------------| | split pane vertically | ^b % | | |----------------------------------------------+-------------------------------+------------------| | switch to another pane | ^b o | | |----------------------------------------------+-------------------------------+------------------| | kill the current pane | ^b x OR (logout/^D) | | |----------------------------------------------+-------------------------------+------------------| | close other panes except the current one | ^b ! | | |----------------------------------------------+-------------------------------+------------------| | swap location of panes | ^b ^o | | |----------------------------------------------+-------------------------------+------------------| | show time | ^b t | | +-------------------------------------------------------------------------------------------------+ |
Share the post "Screen cheat list"
MoC theme
26/08/2010
My MoC theme
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 |
# # Theme: pieter_moc_theme # Author: Pieter - pieter.blinkenshell.org # background = white black frame = white black window_title = green black bold directory = white black selected_directory = green black bold playlist = white black selected_playlist = cyan black dim,underline file = white black info = white black selected_file = cyan black dim,underline selected_info = cyan black dim,underline marked_file = cyan black marked_info = cyan black marked_selected_file = cyan black underline marked_selected_info = cyan black underline status = red black bold title = cyan black bold,underline state = red black bold current_time = green black bold time_left = green black bold total_time = green black bold time_total_frames = green black bold sound_parameters = white black bold legend = white black disabled = white black dim enabled = red black bold empty_mixer_bar = white black dim filled_mixer_bar = black white empty_time_bar = white black dim filled_time_bar = white white dim entry = white black entry_title = magenta black bold error = red black bold message = green black bold plist_time = green black bold |
Share the post "MoC theme"