Posts tagged ·

linux

·...

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…

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()

Screen cheat list

no comments

Found this cheatlist somewhere…

Credits to the one who uploaded it ..


+-------------------------------------------------------------------------------------------------+
| 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 , OR | ^a A |
| | ^b :rename-window | |
|----------------------------------------------+-------------------------------+------------------|
| 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 | |
+-------------------------------------------------------------------------------------------------+

MoC theme

no comments

My MoC theme


#
# 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

Newsbeuter 2.1 theme

no comments

Found a nice theme here in the comments: Newsbeuter 2.1 will contain support for 256-color terminals « Newsbeuter Development Blog.

# Generic Background
# First value is not used.
color background magenta color237

#Text/background when reading an article
color article color188 color237

#Color the listview items
color listnormal color188 color237

#Selected listveiew item.
color listfocus color108 color236

# info
color info color144 color234

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!.

Resize Linux Terminator how you want it.

no comments

If you use terminator but want it to startup with the size you want then run it like this:

terminator –geometry=800×400+150+150

800×400 is the size ot the screen and 150+150 the position where it should popup.

!# 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.