SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 Re: Tips, Tricks & Scripts » My Conky Config » 2011-05-01 14:15:57

back with new conky
screenepic.th.png

alignment tr
gap_x 200
gap_y 120
#maximum_width 340 120
#minimum_size 340 120
own_window false
own_window_hints undecorated, above, sticky, skip_taskbar, skip_pager
own_window_transparent true
own_window_type desktop
draw_borders no
draw_graph_borders no
border_width 1
default_color ffffff
use_xft yes
xftalpha 0.8
xftfont Droid Sans:size=10
no_buffers no
double_buffer yes
total_run_times 0
update_interval 1
draw_shades no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
stippled_borders 2
color0 333333

TEXT
${offset 140}${font Droid Sans:size=22}${time %d. %b}$color0${time %k:%M}$font$color
$alignr$nodename
$alignr$uptime ${color0}online$color
${voffset -3}$color0+ ram:$color ${voffset 1}${membar 5,100} $alignr $color0 cpu:$color ${voffset 1}${cpubar 5,100}
${voffset -3}$color0+ hdd:$color ${voffset 1}${fs_bar 5,100 /} $alignr $color0 swap:$color ${voffset 1}${swapbar 5,100}
${voffset -3}$color0+ up:$color ${upspeedgraph eth0 10,100}$alignr $color0 down:$color ${downspeedgraph eth0 10,100}
${voffset -3}$color0+ intern:$color    ${addr eth0} $alignr $color0 extern:      $color ${execi 3600 wget -O - http://ip.tupeux.com| tail}
${voffset -3}${color0}+ gmail:$color  ${execi 3600 ~/scripts/gmail.pl n}  ${color0}+ updates:  $color${execi 3600 aptitude search "~U" | wc -l}  ${color0}+ wetter: $color${execi 3600 ~/scripts/weather.sh GMXX0007}
${voffset -3}${color0}+ artist:   $color${execi 10 conkyRhythmbox -d AR}
${voffset -3}${color0}+ song:    $color${execi 10 conkyRhythmbox -d TI}
${voffset -3}${color0}+ album: $color${execi 10 conkyRhythmbox -d AL}

gmail.pl and weather.sh can be found on page 87
if ur using rhythmobx u've to install conkyRhythmbox

sudo add-apt-repository ppa:conky-companions/ppa
sudo apt-get update && sudo apt-get install conkyrhythmbox

#2 Re: Tips, Tricks & Scripts » My Conky Config » 2011-04-19 08:39:00

anonymous wrote:

@phrk - Please remember to use code tags not quote tags when posting scripts, output, configs etc.

sry didnt read the rules yet

i updated my conky. now with weather, some graphs, font colors..

alignment tr
gap_x 5
gap_y 40
maximum_width 300
minimum_size 200
own_window false
own_window_hints undecorated, above, sticky, skip_taskbar, skip_pager
own_window_transparent true
own_window_type desktop
draw_borders no
draw_graph_borders yes
border_width 1
default_color ffffff
use_xft yes
xftalpha 1
xftfont Arial:size=9
#no_buffers yes
double_buffer yes
total_run_times 0
update_interval 1
draw_shades no
cpu_avg_samples 1
net_avg_samples 1
override_utf8_locale yes
color0 ad0001
color1 999999

TEXT
${color0}S Y S T E M I N F O
${hr}${color}
hostname:${alignr}${color1}$nodename${color}
kernel:${alignr}${color1}$kernel${color}
uptime:$alignr${color1}$uptime${color}
prozesse:${alignr}${color1}$processes${color}
ram:${alignr}${color1}$memperc %${color}$color0 ${membar 5,100}$color
${font Arial:size=8}${alignr}$mem von $memmax${font}
cpu:${alignr}${color1}$cpu %${color}  $color0${cpubar 5,100}$color
taktung:$alignr${color1}$freq${color}
${voffset 5}${color0}P R O Z E S S E
${hr}${color}
name                      pid         cpu%   mem%
${color1}${top_mem name 1}${alignr}${offset -35}${top_mem pid 1}${offset 15}${top_mem cpu 1}${offset 15}${top_mem mem 1}
${top_mem name 2}${alignr}${offset -35}${top_mem pid 2}${offset 15}${top_mem cpu 2}${offset 15}${top_mem mem 2}
${top_mem name 3}${alignr}${offset -35}${top_mem pid 3}${offset 15}${top_mem cpu 3}${offset 15}${top_mem mem 3}${color}
${voffset 5}${color0}N E T Z W E R K
${hr}${color}
ip intern:${alignr}${color1}${addr eth0}${color}
ip extern:${alignr}${color1}${execi 7200 ~/scripts/publicip.sh}${color}
verbindungen:${alignr}${color1}in:$color ${tcp_portmon 1 32767 count} ${color1}out:$color ${tcp_portmon 32768 61000 count} ${color1}all:$color ${tcp_portmon 1 65535 count}

up:${alignr}${color1}${upspeedf eth0}${color} kb/s
${upspeedgraph eth0 25,200 ad0001 999999}
down:${alignr}${color1}$downspeedf${color} kb/s
${downspeedgraph eth0 25,200 ad0001 999999}
${voffset 5}${color0}D A T U M
${hr}${color}
$alignc${font Arial:size=22}   ${time %H:%M:%S}${font}
$alignr${color1}${time %A %d. %B}${color}
${voffset 5}${color0}H D D s
${hr}${color}
hda:$alignr${color1}${fs_used /}${color} / ${color1}${fs_size /}${color}
swap:$alignr${color1}$swap${color}/ ${color1}$swapmax${color}
${voffset 5}${color0}E M A I L
${hr}${color}
gmail:$alignr${color1}${execi 60 perl ~/scripts/gmail.pl e}$color
cah:$alignr${color1}${imap_unseen [imap.example.com] [user] [password] [-i 60]}${color} neue EMail(s).
${voffset 5}${color0}U P D A T E S
${hr}${color}
Es sind ${color1}${execi 1800 aptitude search "~U" | wc -l}${color} Updates verfuegbar.
${voffset 5}${color0}W E T T E R
${hr}${color}
${execi 7200 ~/scripts/weather.sh GMXX0007}

gmail.py again

#!/usr/bin/perl

use Switch;
use Text::Wrap;

my $what=$ARGV[0];

$user="user"; #username for gmail account
$pass="password"; #password for gmail account
$file="/tmp/gmail.html"; #temporary file to store gmail

#wrap format for subject
$Text::Wrap::columns=65; #Number of columns to wrap subject at
$initial_tab=""; #Tab for first line of subject
$subsequent_tab="\t"; #tab for wrapped lines
$quote="\""; #put quotes around subject

#limit the number of emails to be displayed
$emails=4; #if -1 display all emails

&passwd; #give password the proper url character encoding

switch($what){ #determine what the user wants
    case "n" {&gmail; print "$new\n";} #print number of new emails
    case "s" { #print $from and $subj for new email
        &gmail;
        if ($new>0){
            my $size=@from;
            if ($emails!=-1 && $size>$emails){$size=$emails;} #limit number of emails displayed
            for(my $i=0; $i<$size; ++$i){
                print "From: $from[$i]\n"; #print from line
                $text=$quote.$subj[$i].$quote."\n";
                print wrap($initial_tab, $subsequent_tab, $text); #print subject with word wrap
            }
            $size=@from;
            if ($emails!=-1 && $size >$emails){print "$emails out of $size new emails displayed\n";}
        }
    }     
    case "e" { #print number of new emails, $from, and $subj
        &gmail;
        if($new==0){print "Keine neuen Emails.\n";}
        else{
            print "$new neue Email(s).\n";
            my $size=@from;
            if ($emails!=-1 && $size>$emails){$size=$emails;} #limit number of emails displayed
            for(my $i=0; $i<$size; ++$i){
                print "From: $from[$i]\n"; #print from line
                $text=$quote.$subj[$i].$quote;
                print wrap($initial_tab, $subsequent_tab, $text); #print subject with word wrap
            }
            $size=@from;
            if ($emails!=-1 && $size >$emails){print "$emails out of $size new emails displayed\n";}
        }
    }
    else {
        print "Usage Error: gmail.pl <option>\n";
        print "\tn displays number of new emails\n";
        print "\ts displays from line and subject line for each new email.\n";
        print "\te displays the number of new emails and from line plus \n";
        print "\t\tsubject line for each new email.\n";
    } #didn't give proper option
}

sub gmail{
    if(!(-e $file)){ #create file if it does not exists
        `touch $file`;
    } 

    #get new emails
    `wget -O - https://$user:$pass\@mail.google.com/mail/feed/atom --no-check-certificate> $file`;

    open(IN, $file); #open $file

    my $i=0; #initialize count
    $new=0; #initialize new emails to 0

    my $flag=0;

    while(<IN>){ #cycle through $file
        if(/<entry>/){$flag=1;}
        elsif(/<fullcount>(\d+)<\/fullcount>/){$new=$1;} #grab number of new emails
        elsif($flag==1){ 
            if(/<title>.+<\/title>/){push(@subj, &msg);} #grab new email titles
            elsif(/<name>(.+)<\/name>/){push(@from, $1); $flag=0;} #grab new email from lines
        }
    }

    close(IN); #close $file
}

sub passwd{ #change to url escape codes in password
    #URL ESCAPE CODES
    $_=$pass;
    s/\%/\%25/g;
    s/\#/\%23/g;
    s/\$/\%24/g;
    s/\&/\%26/g;
    s/\//\%2F/g;
    s/\:/\%3A/g;
    s/\;/\%3B/g;
    s/\</\%3C/g;
    s/\=/\%3D/g;
    s/\>/\%3E/g;
    s/\?/\%3F/g;
    s/\@/\%40/g;
    s/\[/\%5B/g;
    s/\\/\%5C/g;
    s/\]/\%5D/g;
    s/\^/\%5E/g;
    s/\`/\%60/g;
    s/\{/\%7B/g;
    s/\|/\%7C/g;
    s/\}/\%7D/g;
    s/\~/\%7E/g;
    $pass=$_;
}

sub msg{
    #THE HTML CODED CHARACTER SET [ISO-8859-1]
    chomp; s/<title>(.+)<\/title>/$1/; #get just the subject
    #now replace any special characters
    s/\&\#33\;/!/g;        #Exclamation mark
    s/\&\#34\;/"/g; s/\&quot\;/"/g;      #Quotation mark
    s/\&\#35\;/#/g;        #Number sign
    s/\&\#36\;/\$/g;        #Dollar sign
    s/\&\#37\;/%/g;        #Percent sign
    s/\&\#38\;/&/g; s/\&amp\;/&/g;        #Ampersand
    s/\&\#39\;/'/g;        #Apostrophe
    s/\&\#40\;/(/g;        #Left parenthesis
    s/\&\#41\;/)/g;        #Right parenthesis
    s/\&\#42\;/*/g;        #Asterisk
    s/\&\#43\;/+/g;        #Plus sign
    s/\&\#44\;/,/g;        #Comma
    s/\&\#45\;/-/g;        #Hyphen
    s/\&\#46\;/./g;        #Period (fullstop)
    s/\&\#47\;/\//g;        #Solidus (slash)
    s/\&\#58\;/:/g;        #Colon
    s/\&\#59\;/\;/g;        #Semi-colon
    s/\&\#60\;/</g; s/\&lt\;/</g;        #Less than
    s/\&\#61\;/=/g;        #Equals sign
    s/\&\#62\;/>/g; s/\&gt\;/>/g;        #Greater than
    s/\&\#63\;/\?/g;        #Question mark
    s/\&\#64\;/\@/g;        #Commercial at
    s/\&\#91\;/\[/g;        #Left square bracket
    s/\&\#92\;/\\/g;        #Reverse solidus (backslash)
    s/\&\#93\;/\]/g;        #Right square bracket
    s/\&\#94\;/\^/g;        #Caret
    s/\&\#95\;/_/g;        #Horizontal bar (underscore)
    s/\&\#96\;/\`/g;        #Acute accent
    s/\&\#123\;/\{/g;        #Left curly brace
    s/\&\#124\;/|/g;        #Vertical bar
    s/\&\#125\;/\}/g;        #Right curly brace
    s/\&\#126\;/~/g;        #Tilde
    s/\&\#161\;/¡/g;        #Inverted exclamation
    s/\&\#162\;/¢/g;        #Cent sign
    s/\&\#163\;/£/g;        #Pound sterling
    s/\&\#164\;/¤/g;        #General currency sign
    s/\&\#165\;/¥/g;        #Yen sign
    s/\&\#166\;/¦/g;        #Broken vertical bar
    s/\&\#167\;/§/g;        #Section sign
    s/\&\#168\;/¨/g;        #Umlaut (dieresis)
    s/\&\#169\;/©/g; s/\&copy\;/©/g;        #Copyright
    s/\&\#170\;/ª/g;        #Feminine ordinal
    s/\&\#171\;/«/g;        #Left angle quote, guillemotleft
    s/\&\#172\;/¬/g;        #Not sign
    s/\&\#174\;/®/g;        #Registered trademark
    s/\&\#175\;/¯/g;        #Macron accent
    s/\&\#176\;/°/g;        #Degree sign
    s/\&\#177\;/±/g;        #Plus or minus
    s/\&\#178\;/²/g;        #Superscript two
    s/\&\#179\;/³/g;        #Superscript three
    s/\&\#180\;/´/g;        #Acute accent
    s/\&\#181\;/µ/g;        #Micro sign
    s/\&\#182\;/¶/g;        #Paragraph sign
    s/\&\#183\;/·/g;        #Middle dot
    s/\&\#184\;/¸/g;        #Cedilla
    s/\&\#185\;/¹/g;        #Superscript one
    s/\&\#186\;/º/g;        #Masculine ordinal
    s/\&\#187\;/»/g;        #Right angle quote, guillemotright
    s/\&\#188\;/¼/g; s/\&frac14\;/¼/g;       # Fraction one-fourth
    s/\&\#189\;/½/g; s/\&frac12\;/½/g;       # Fraction one-half
    s/\&\#190\;/¾/g; s/\&frac34\;/¾/g;       # Fraction three-fourths
    s/\&\#191\;/¿/g;        #Inverted question mark
    s/\&\#192\;/À/g;        #Capital A, grave accent
    s/\&\#193\;/Á/g;        #Capital A, acute accent
    s/\&\#194\;/Â/g;        #Capital A, circumflex accent
    s/\&\#195\;/Ã/g;        #Capital A, tilde
    s/\&\#196\;/Ä/g;        #Capital A, dieresis or umlaut mark
    s/\&\#197\;/Å/g;        #Capital A, ring
    s/\&\#198\;/Æ/g;        #Capital AE dipthong (ligature)
    s/\&\#199\;/Ç/g;        #Capital C, cedilla
    s/\&\#200\;/È/g;        #Capital E, grave accent
    s/\&\#201\;/É/g;        #Capital E, acute accent
    s/\&\#202\;/Ê/g;        #Capital E, circumflex accent
    s/\&\#203\;/Ë/g;        #Capital E, dieresis or umlaut mark
    s/\&\#204\;/Ì/g;        #Capital I, grave accent
    s/\&\#205\;/Í/g;        #Capital I, acute accent
    s/\&\#206\;/Î/g;        #Capital I, circumflex accent
    s/\&\#207\;/Ï/g;        #Capital I, dieresis or umlaut mark   
    s/\&\#208\;/Ð/g;        #Capital Eth, Icelandic
    s/\&\#209\;/Ñ/g;        #Capital N, tilde
    s/\&\#210\;/Ò/g;        #Capital O, grave accent
    s/\&\#211\;/Ó/g;        #Capital O, acute accent
    s/\&\#212\;/Ô/g;        #Capital O, circumflex accent
    s/\&\#213\;/Õ/g;        #Capital O, tilde
    s/\&\#214\;/Ö/g;        #Capital O, dieresis or umlaut mark
    s/\&\#215\;/×/g;        #Multiply sign
    s/\&\#216\;/Ø/g;        #Capital O, slash
    s/\&\#217\;/Ù/g;        #Capital U, grave accent
    s/\&\#218\;/Ú/g;        #Capital U, acute accent
    s/\&\#219\;/Û/g;        #Capital U, circumflex accent
    s/\&\#220\;/Ü/g;        #Capital U, dieresis or umlaut mark
    s/\&\#221\;/Ý/g;        #Capital Y, acute accent
    s/\&\#222\;/Þ/g;        #Capital THORN, Icelandic
    s/\&\#223\;/ß/g;        #Small sharp s, German (sz ligature)
    s/\&\#224\;/à/g;        #Small a, grave accent
    s/\&\#225\;/á/g;        #Small a, acute accent
    s/\&\#226\;/â/g;        #Small a, circumflex accent
    s/\&\#227\;/ã/g;        #Small a, tilde
    s/\&\#228\;/ä/g;        #Small a, dieresis or umlaut mark
    s/\&\#229\;/å/g;        #Small a, ring
    s/\&\#230\;/æ/g;        #Small ae dipthong (ligature)
    s/\&\#231\;/ç/g;        #Small c, cedilla
    s/\&\#232\;/è/g;        #Small e, grave accent
    s/\&\#233\;/é/g;        #Small e, acute accent
    s/\&\#234\;/ê/g;        #Small e, circumflex accent
    s/\&\#235\;/ë/g;        #Small e, dieresis or umlaut mark
    s/\&\#236\;/ì/g;        #Small i, grave accent
    s/\&\#237\;/í/g;        #Small i, acute accent
    s/\&\#238\;/î/g;        #Small i, circumflex accent
    s/\&\#239\;/ï/g;        #Small i, dieresis or umlaut mark
    s/\&\#240\;/ð/g;        #Small eth, Icelandic
    s/\&\#241\;/ñ/g;        #Small n, tilde
    s/\&\#242\;/ò/g;        #Small o, grave accent
    s/\&\#243\;/ó/g;        #Small o, acute accent
    s/\&\#244\;/ô/g;        #Small o, circumflex accent
    s/\&\#245\;/õ/g;        #Small o, tilde
    s/\&\#246\;/ö/g;        #Small o, dieresis or umlaut mark
    s/\&\#247\;/÷/g;        #Division sign
    s/\&\#248\;/ø/g;        #Small o, slash
    s/\&\#249\;/ù/g;        #Small u, grave accent
    s/\&\#250\;/ú/g;        #Small u, acute accent
    s/\&\#251\;/û/g;        #Small u, circumflex accent
    s/\&\#252\;/ü/g;        #Small u, dieresis or umlaut mark
    s/\&\#253\;/ý/g;        #Small y, acute accent
    s/\&\#254\;/þ/g;        #Small thorn, Icelandic
    s/\&\#255\;/ÿ/g;        #Small y, dieresis or umlaut mark
    s/^\s+//;
    return $_;
}

the weather.sh from weather.tuxnet24.de
Remember to install lynx

sudo aptitude install lynx

coz tuxnet24 has a script to format the yahoo weather rss smile

#!/bin/bash
# ********************************************************
# file: weather.sh
# date: 2008-11-19 23:04
# author: Marko Schulz - <info@tuxnet24.de>
# description: Script to get the current weather data.
# ********************************************************
#
# EXAMPLE:
# tux@earth:~$ ./weather.sh GMXX0007
#
# Define the page where you get the weather informations.
page="http://weather.tuxnet24.de/?id="
#
# ********************************************************
# This function connect to the weather page and convert the
# output as keys/value pairs.

function rc_weather () {

local url=$1
for line in $( lynx -source $url | egrep -v '^$' | sed 's/[[:space:]]/@/g' ) ; do
    local data=$( echo $line | sed 's/@/ /g' )
    keys=$( echo $data | cut -d= -f1 | sed 's/[[:space:]]$//g' )
    value=$( echo $data | cut -d= -f2 | sed 's/^[[:space:]]//g' )
    eval $keys="\$value"
done

}

# ********************************************************
# program action...

# Get the location code from command line.
location=$1

# Exit the program with 1 if no location code was defined.
[ -z "$location" ] && exit 1

# Get the weather from http://weather.tuxnet24.de/.
rc_weather "${page}${location}"

# Set up the conky [text_buffer_size] to 256 or higher.
# Ubuntu do not display the ° sign correctly even the LANG settings are set to UTF-8.
# I have no solution for this problem.

echo -e "Aktuelles Wetter - ${city}"
echo -e "${current_text}, ${current_temp}"
echo -e "Sicht: ${visibility}"
echo -e "Luftfeuchtigkeit: ${humidity}"
echo -e "Wind: ${speed}, ${direction}\n"
echo -e "Vorhersage: ${tomorrow_day}, ${tomorrow_date}"
echo -e "${tomorrow_text}, min. ${tomorrow_temp_low}, max. ${tomorrow_temp_high}"
exit 0

# ********************************************************
# EOF

and publicip script can be found on http://wiki.ubuntuusers.de/Conky/Skripte#ffentliche-IP

and a screenshot
bildschirmfoto1o.th.png

Uploaded with ImageShack.us

#3 Re: Tips, Tricks & Scripts » My Conky Config » 2011-04-18 00:30:29

crunchy wrote:

could you please post gmail.pl please! smile big_smile

sure...

#!/usr/bin/perl

use Switch;
use Text::Wrap;

my $what=$ARGV[0];

$user="user"; #username for gmail account
$pass="passwd"; #password for gmail account
$file="/tmp/gmail.html"; #temporary file to store gmail

#wrap format for subject
$Text::Wrap::columns=65; #Number of columns to wrap subject at
$initial_tab=""; #Tab for first line of subject
$subsequent_tab="\t"; #tab for wrapped lines
$quote="\""; #put quotes around subject

#limit the number of emails to be displayed
$emails=4; #if -1 display all emails

&passwd; #give password the proper url character encoding

switch($what){ #determine what the user wants
    case "n" {&gmail; print "$new\n";} #print number of new emails
    case "s" { #print $from and $subj for new email
        &gmail;
        if ($new>0){
            my $size=@from;
            if ($emails!=-1 && $size>$emails){$size=$emails;} #limit number of emails displayed
            for(my $i=0; $i<$size; ++$i){
                print "From: $from[$i]\n"; #print from line
                $text=$quote.$subj[$i].$quote."\n";
                print wrap($initial_tab, $subsequent_tab, $text); #print subject with word wrap
            }
            $size=@from;
            if ($emails!=-1 && $size >$emails){print "$emails out of $size new emails displayed\n";}
        }
    }     
    case "e" { #print number of new emails, $from, and $subj
        &gmail;
        if($new==0){print "Du hast keine neuen Nachrichten.\n";}
        else{
            print "Du hast $new neue Email(s).\n";
            my $size=@from;
            if ($emails!=-1 && $size>$emails){$size=$emails;} #limit number of emails displayed
            for(my $i=0; $i<$size; ++$i){
                print "From: $from[$i]\n"; #print from line
                $text=$quote.$subj[$i].$quote;
                print wrap($initial_tab, $subsequent_tab, $text); #print subject with word wrap
            }
            $size=@from;
            if ($emails!=-1 && $size >$emails){print "$emails out of $size new emails displayed\n";}
        }
    }
    else {
        print "Usage Error: gmail.pl <option>\n";
        print "\tn displays number of new emails\n";
        print "\ts displays from line and subject line for each new email.\n";
        print "\te displays the number of new emails and from line plus \n";
        print "\t\tsubject line for each new email.\n";
    } #didn't give proper option
}

sub gmail{
    if(!(-e $file)){ #create file if it does not exists
        `touch $file`;
    } 

    #get new emails
    `wget -O - https://$user:$pass\@mail.google.com/mail/feed/atom --no-check-certificate> $file`;

    open(IN, $file); #open $file

    my $i=0; #initialize count
    $new=0; #initialize new emails to 0

    my $flag=0;

    while(<IN>){ #cycle through $file
        if(/<entry>/){$flag=1;}
        elsif(/<fullcount>(\d+)<\/fullcount>/){$new=$1;} #grab number of new emails
        elsif($flag==1){ 
            if(/<title>.+<\/title>/){push(@subj, &msg);} #grab new email titles
            elsif(/<name>(.+)<\/name>/){push(@from, $1); $flag=0;} #grab new email from lines
        }
    }

    close(IN); #close $file
}

sub passwd{ #change to url escape codes in password
    #URL ESCAPE CODES
    $_=$pass;
    s/\%/\%25/g;
    s/\#/\%23/g;
    s/\$/\%24/g;
    s/\&/\%26/g;
    s/\//\%2F/g;
    s/\:/\%3A/g;
    s/\;/\%3B/g;
    s/\</\%3C/g;
    s/\=/\%3D/g;
    s/\>/\%3E/g;
    s/\?/\%3F/g;
    s/\@/\%40/g;
    s/\[/\%5B/g;
    s/\\/\%5C/g;
    s/\]/\%5D/g;
    s/\^/\%5E/g;
    s/\`/\%60/g;
    s/\{/\%7B/g;
    s/\|/\%7C/g;
    s/\}/\%7D/g;
    s/\~/\%7E/g;
    $pass=$_;
}

sub msg{
    #THE HTML CODED CHARACTER SET [ISO-8859-1]
    chomp; s/<title>(.+)<\/title>/$1/; #get just the subject
    #now replace any special characters
    s/\&\#33\;/!/g;        #Exclamation mark
    s/\&\#34\;/"/g; s/\&quot\;/"/g;      #Quotation mark
    s/\&\#35\;/#/g;        #Number sign
    s/\&\#36\;/\$/g;        #Dollar sign
    s/\&\#37\;/%/g;        #Percent sign
    s/\&\#38\;/&/g; s/\&amp\;/&/g;        #Ampersand
    s/\&\#39\;/'/g;        #Apostrophe
    s/\&\#40\;/(/g;        #Left parenthesis
    s/\&\#41\;/)/g;        #Right parenthesis
    s/\&\#42\;/*/g;        #Asterisk
    s/\&\#43\;/+/g;        #Plus sign
    s/\&\#44\;/,/g;        #Comma
    s/\&\#45\;/-/g;        #Hyphen
    s/\&\#46\;/./g;        #Period (fullstop)
    s/\&\#47\;/\//g;        #Solidus (slash)
    s/\&\#58\;/:/g;        #Colon
    s/\&\#59\;/\;/g;        #Semi-colon
    s/\&\#60\;/</g; s/\&lt\;/</g;        #Less than
    s/\&\#61\;/=/g;        #Equals sign
    s/\&\#62\;/>/g; s/\&gt\;/>/g;        #Greater than
    s/\&\#63\;/\?/g;        #Question mark
    s/\&\#64\;/\@/g;        #Commercial at
    s/\&\#91\;/\[/g;        #Left square bracket
    s/\&\#92\;/\\/g;        #Reverse solidus (backslash)
    s/\&\#93\;/\]/g;        #Right square bracket
    s/\&\#94\;/\^/g;        #Caret
    s/\&\#95\;/_/g;        #Horizontal bar (underscore)
    s/\&\#96\;/\`/g;        #Acute accent
    s/\&\#123\;/\{/g;        #Left curly brace
    s/\&\#124\;/|/g;        #Vertical bar
    s/\&\#125\;/\}/g;        #Right curly brace
    s/\&\#126\;/~/g;        #Tilde
    s/\&\#161\;/¡/g;        #Inverted exclamation
    s/\&\#162\;/¢/g;        #Cent sign
    s/\&\#163\;/£/g;        #Pound sterling
    s/\&\#164\;/¤/g;        #General currency sign
    s/\&\#165\;/¥/g;        #Yen sign
    s/\&\#166\;/¦/g;        #Broken vertical bar
    s/\&\#167\;/§/g;        #Section sign
    s/\&\#168\;/¨/g;        #Umlaut (dieresis)
    s/\&\#169\;/©/g; s/\&copy\;/©/g;        #Copyright
    s/\&\#170\;/ª/g;        #Feminine ordinal
    s/\&\#171\;/«/g;        #Left angle quote, guillemotleft
    s/\&\#172\;/¬/g;        #Not sign
    s/\&\#174\;/®/g;        #Registered trademark
    s/\&\#175\;/¯/g;        #Macron accent
    s/\&\#176\;/°/g;        #Degree sign
    s/\&\#177\;/±/g;        #Plus or minus
    s/\&\#178\;/²/g;        #Superscript two
    s/\&\#179\;/³/g;        #Superscript three
    s/\&\#180\;/´/g;        #Acute accent
    s/\&\#181\;/µ/g;        #Micro sign
    s/\&\#182\;/¶/g;        #Paragraph sign
    s/\&\#183\;/·/g;        #Middle dot
    s/\&\#184\;/¸/g;        #Cedilla
    s/\&\#185\;/¹/g;        #Superscript one
    s/\&\#186\;/º/g;        #Masculine ordinal
    s/\&\#187\;/»/g;        #Right angle quote, guillemotright
    s/\&\#188\;/¼/g; s/\&frac14\;/¼/g;       # Fraction one-fourth
    s/\&\#189\;/½/g; s/\&frac12\;/½/g;       # Fraction one-half
    s/\&\#190\;/¾/g; s/\&frac34\;/¾/g;       # Fraction three-fourths
    s/\&\#191\;/¿/g;        #Inverted question mark
    s/\&\#192\;/À/g;        #Capital A, grave accent
    s/\&\#193\;/Á/g;        #Capital A, acute accent
    s/\&\#194\;/Â/g;        #Capital A, circumflex accent
    s/\&\#195\;/Ã/g;        #Capital A, tilde
    s/\&\#196\;/Ä/g;        #Capital A, dieresis or umlaut mark
    s/\&\#197\;/Å/g;        #Capital A, ring
    s/\&\#198\;/Æ/g;        #Capital AE dipthong (ligature)
    s/\&\#199\;/Ç/g;        #Capital C, cedilla
    s/\&\#200\;/È/g;        #Capital E, grave accent
    s/\&\#201\;/É/g;        #Capital E, acute accent
    s/\&\#202\;/Ê/g;        #Capital E, circumflex accent
    s/\&\#203\;/Ë/g;        #Capital E, dieresis or umlaut mark
    s/\&\#204\;/Ì/g;        #Capital I, grave accent
    s/\&\#205\;/Í/g;        #Capital I, acute accent
    s/\&\#206\;/Î/g;        #Capital I, circumflex accent
    s/\&\#207\;/Ï/g;        #Capital I, dieresis or umlaut mark   
    s/\&\#208\;/Ð/g;        #Capital Eth, Icelandic
    s/\&\#209\;/Ñ/g;        #Capital N, tilde
    s/\&\#210\;/Ò/g;        #Capital O, grave accent
    s/\&\#211\;/Ó/g;        #Capital O, acute accent
    s/\&\#212\;/Ô/g;        #Capital O, circumflex accent
    s/\&\#213\;/Õ/g;        #Capital O, tilde
    s/\&\#214\;/Ö/g;        #Capital O, dieresis or umlaut mark
    s/\&\#215\;/×/g;        #Multiply sign
    s/\&\#216\;/Ø/g;        #Capital O, slash
    s/\&\#217\;/Ù/g;        #Capital U, grave accent
    s/\&\#218\;/Ú/g;        #Capital U, acute accent
    s/\&\#219\;/Û/g;        #Capital U, circumflex accent
    s/\&\#220\;/Ü/g;        #Capital U, dieresis or umlaut mark
    s/\&\#221\;/Ý/g;        #Capital Y, acute accent
    s/\&\#222\;/Þ/g;        #Capital THORN, Icelandic
    s/\&\#223\;/ß/g;        #Small sharp s, German (sz ligature)
    s/\&\#224\;/à/g;        #Small a, grave accent
    s/\&\#225\;/á/g;        #Small a, acute accent
    s/\&\#226\;/â/g;        #Small a, circumflex accent
    s/\&\#227\;/ã/g;        #Small a, tilde
    s/\&\#228\;/ä/g;        #Small a, dieresis or umlaut mark
    s/\&\#229\;/å/g;        #Small a, ring
    s/\&\#230\;/æ/g;        #Small ae dipthong (ligature)
    s/\&\#231\;/ç/g;        #Small c, cedilla
    s/\&\#232\;/è/g;        #Small e, grave accent
    s/\&\#233\;/é/g;        #Small e, acute accent
    s/\&\#234\;/ê/g;        #Small e, circumflex accent
    s/\&\#235\;/ë/g;        #Small e, dieresis or umlaut mark
    s/\&\#236\;/ì/g;        #Small i, grave accent
    s/\&\#237\;/í/g;        #Small i, acute accent
    s/\&\#238\;/î/g;        #Small i, circumflex accent
    s/\&\#239\;/ï/g;        #Small i, dieresis or umlaut mark
    s/\&\#240\;/ð/g;        #Small eth, Icelandic
    s/\&\#241\;/ñ/g;        #Small n, tilde
    s/\&\#242\;/ò/g;        #Small o, grave accent
    s/\&\#243\;/ó/g;        #Small o, acute accent
    s/\&\#244\;/ô/g;        #Small o, circumflex accent
    s/\&\#245\;/õ/g;        #Small o, tilde
    s/\&\#246\;/ö/g;        #Small o, dieresis or umlaut mark
    s/\&\#247\;/÷/g;        #Division sign
    s/\&\#248\;/ø/g;        #Small o, slash
    s/\&\#249\;/ù/g;        #Small u, grave accent
    s/\&\#250\;/ú/g;        #Small u, acute accent
    s/\&\#251\;/û/g;        #Small u, circumflex accent
    s/\&\#252\;/ü/g;        #Small u, dieresis or umlaut mark
    s/\&\#253\;/ý/g;        #Small y, acute accent
    s/\&\#254\;/þ/g;        #Small thorn, Icelandic
    s/\&\#255\;/ÿ/g;        #Small y, dieresis or umlaut mark
    s/^\s+//;
    return $_;
}

#4 Re: Tips, Tricks & Scripts » My Conky Config » 2011-04-18 00:15:55

just wanna share my config smile

alignment tr
gap_x 15
gap_y 40
maximum_width 300
minimum_size 200
own_window false
own_window_hints undecorated, above, sticky, skip_taskbar, skip_pager
own_window_transparent true
own_window_type desktop
draw_borders no
draw_graph_borders no
border_width 1
default_color ffffff
use_xft yes
xftalpha 1
xftfont Arial:size=9
#no_buffers yes
double_buffer yes
total_run_times 0
update_interval 1
draw_shades no
cpu_avg_samples 1
net_avg_samples 1
override_utf8_locale no
color0 ad0001
color1 999999

TEXT
${color0}S Y S T E M I N F O${color}
${hr}
hostname:${alignr}dellNB
kernel:${alignr}$kernel
uptime:$alignr$uptime
prozesse:${alignr}$processes
ram:${alignr}$mem / $memmax
cpu:${alignr}$cpu%
${voffset 5}${color0}P R O Z E S S E${color}
${hr}
name                      pid         cpu%   mem%
${color1}${top_mem name 1}${alignr}${offset -35}${top_mem pid 1}${offset 15}${top_mem cpu 1}${offset 15}${top_mem mem 1}
${top_mem name 2}${alignr}${offset -35}${top_mem pid 2}${offset 15}${top_mem cpu 2}${offset 15}${top_mem mem 2}
${top_mem name 3}${alignr}${offset -35}${top_mem pid 3}${offset 15}${top_mem cpu 3}${offset 15}${top_mem mem 3}${color}
${voffset 5}${color0}N E T Z W E R K${color}
${hr}
up:${alignr}${upspeedf eth0} kb/s
down:${alignr}$downspeedf kb/s
ip intern:${alignr}${addr eth0}
ip extern:${alignr}${execi 7200 ~/scripts/publicip.sh}
verbindungen:${alignr}${color1}in:$color ${tcp_portmon 1 32767 count}  ${color1}out:$color ${tcp_portmon 32768 61000 count}   ${color1}all:$color ${tcp_portmon 1 65535 count}
${voffset 5}${color0}D A T U M${color}
${hr}
$alignc${font Arial:size=22}   ${time %H:%M:%S}${font}
$alignr${time %A %d. %B}
${voffset 5}${color0}H D D s${color}
${hr}
hda:$alignr${fs_used /} / ${fs_size /}
swap:$alignr$swap / $swapmax
${voffset 5}${color0}G M A I L${color}
${hr}
${execi 60 perl ~/scripts/gmail.pl e}

and a screen
http://img696.imageshack.us/i/conkyatubuntu.png/

hf smile

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo