[bglug] ArchiLinux goes KDE4.1

Joe Galaxy joegalaxy@gmail.com
Mar 29 Lug 2008 09:28:15 CEST


jimmi wrote:
> Bello! merita un poco di studio :)
Ciąpa il .conkyrc e i vari script di appoggio.

--8<-- CUT HERE --8<-- 
# Conky sample configuration
#
# the list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.

# set to yes if you want Conky to be forked in the background
background yes

# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
#font -artwiz-mintsmild-medium-r-*-*-8-*-*-*-*-*-*-*
#font -misc-fixed-medium-r-normal-*-10-*-*-*-*-*-iso8859-15
#font -artwiz-lime-medium-r-*-*-10-*-*-*-*-*-*-*
font -xos4-terminus-medium-r-*-*-12-*-*-*-*-*-*-*
#font -artwiz-nu-*-*-*-*-11-*-*-*-*-*-*-*

# Use Xft?
use_xft yes

# Set conky on the bottom of all other applications
#on_bottom no

# Xft font when Xft is enabled
#xftfont Bitstream Vera Sans Mono:size=8
#xftfont -misc-fixed-medium-r-normal-*-10-*-*-*-*-*-iso8859-15
xftfont terminus-font:size=8:antialias=true


# Text alpha when using Xft
xftalpha 0.8

# Print everything to stdout?
out_to_console no

# MPD host/port
# mpd_host localhost
# mpd_port 6600
# mpd_password tinker_bell

# Print everything to console?
out_to_console no

# mail spool
#mail_spool $MAIL

# Update interval in seconds
update_interval 1.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window no

# Use pseudo transparency with own_window?
own_window_transparent yes

# If own_window_transparent is set to no, you can set the background colour here
own_window_colour hotpink

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 180 5

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 4

# border margins
border_margin 4

# border width
border_width 0

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color black

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 12
gap_y 12

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale no


# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer no

#   mldonkey_hostname     Hostname for mldonkey stuff, defaults to localhost
#   mldonkey_port         Mldonkey port, 4001 default
#   mldonkey_login        Mldonkey login, default none
#   mldonkey_password     Mldonkey password, default none

# boinc (seti) dir
# seti_dir /opt/seti

# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument

# stuff after 'TEXT' will be formatted on screen

TEXT




${alignc}${color orange}$nodename - $sysname $kernel

${alignc}${color green}${time %a %x  %R}

${alignc}${color grey}CPU Usage:$color $cpu%
${color red}${cpubar}

${alignc}${color grey}RAM Usage:$color $mem/$memmax - $memperc%
${color orange}${membar}

${alignc}${color grey}Swap Usage:$color $swap/$swapmax - $swapperc%
${color purple}${swapbar}

${alignc}${color grey}Uptime:$color $uptime ${color grey}- Load:$color $loadavg
${alignc}${color grey}Processes:$color $processes  ${color grey}Running:$color $running_processes ${color grey}Users: $color${exec ~/.conky/conky_users}


${alignc}${color yellow}eth0 - ${color purple}${addr eth0}  
${color grey}     Down:${color cyan} ${downspeed eth0} K/s${color grey} ${offset 50}Up:${color cyan} ${upspeed eth0} K/s

${alignc}${color yellow}ppp0 - ${color purple}${addr ppp0}  
${color grey}     Down:${color cyan} ${downspeed ppp0} K/s${color grey} ${offset 50}Up:${color cyan} ${upspeed ppp0} K/s

${alignc}${color yellow}wlan0 - ${color purple}${addr wlan0}  
${color grey}     Down:${color cyan} ${downspeed wlan0} K/s${color grey} ${offset 50}Up:${color cyan} ${upspeed wlan0} K/s

${color grey}/ <-> ${color yellow}${fs_size /} ${color grey}[#] ${color red}${fs_used /} ${color grey}[] ${color green}${fs_free /}
${color blue}${fs_bar /}

${alignc}${color grey}Volume: ${color cyan}${execi 5 ~/.conky/conky_volume} 

${alignc}${color grey}Battery: ${color cyan}${execi 5 ~/.conky/conky_bat}

${alignc}${color grey}New Mail: ${color orange}${execi 5 ~/.conky/conky_mailnew}${color grey}
--8<-- CUT HERE --8<-- 

##conky_users:
#!/bin/sh
who | awk '{print $1}' | uniq -c | wc -l

##conky_volume:
#!/bin/sh
vstate=`amixer get Front | grep Left: | awk -F" " '{print $7}'`
lvol=`amixer get Front | grep Left: | awk -F" " '{print $5}'|sed -e 's/\[//' -e 's/\]//'`
rvol=`amixer get Front | grep Right: | awk -F" " '{print $5}'|sed -e 's/\[//' -e 's/\]//'`

if [ "$vstate" = "[on]" ]; then
	echo "R $rvol L $lvol"
else
	echo "(Ų) MUTE"
fi


##conky_bat:
#!/bin/sh
echo `cat /proc/acpi/battery/BAT1/state | grep remaining | cut -c 26-30` / `cat /proc/acpi/battery/BAT1/info|grep 'last full' | cut -c 26-30`*100 | bc -l | cut -c 1-6

##conky_mailnew
#!/bin/sh 
nuovi=`find /home/kbs/Mail/inbox/new -type f | wc -l`
totali=`find /home/kbs/Mail/inbox/cur -type f | wc -l`

if [ "$nuovi" = "0" ] ;
then 
	echo "no new mail"
else
	if [ "$nuovi" = "1" ];
	then 
		echo "$nuovi message"
	else
echo "$nuovi messages"
fi
fi

##conky_ext_ip
#!/bin/sh
#
# Script for getting an external WAN IP
#

URLS[0]="http://checkip.dyndns.org"
URLS[1]="http://whatismyip.com"
URLS[2]="http://www.whatismyipaddress.com"
URLS[3]="http://ipid.shat.net"
URLS[4]="http://www.edpsciences.com/htbin/ipaddress"
URLS[5]="http://www.showmyip.com"

for URL in ${URLS[@]}
do
       THIS=${URL}
       IP=`curl -s "${THIS}" | tr -cs '[0-9\.]' '\012' \
               | awk -F'.' 'NF==4 && $1>0 && $1<256 && $2<256 && $3<256 && $4<256 && !/\.\./' | uniq`
       if [ $? == 0 ]; then
               IP=`echo $IP | awk '{print $1}'`
               echo "$IP"
               exit
       fi
done

##conky_calendar
#! /bin/sh
#${color #68ABEF}Calendar ${hr 2}
#${color lightgrey}${execi 1 ~/.conky/get_calendar.sh first_part}${color
#68ABEF}${execi 1 ~/.conky/get_calendar.sh today }${color }${execi 1 ~/.conky/get_calendar.sh second_part}


#str=`echo '\033[01;32m29'`

DATE=`date | awk -F" " '{print $3}'`

case "$1" in
first_part)
cal | grep '[a-zA-Z]';
cal | grep -v '[a-zA-Z]' | grep '[0-9]' | awk -F$DATE ' BEGIN {i=0}
($1 == $0 && i==0) {print $1}
($1 != $0 && i==0){i=i+1;print $1}';
;;
today)
echo $DATE;
;;
second_part)
cal | grep -v '[a-zA-Z]' | grep '[0-9]' | awk -F$DATE ' BEGIN {i=1}
(i==0) {print $0}
($1 != $0 && i==1){i=i-1;print $2}
';
;;
esac

##conky_weather
#!/bin/sh
#
# Grab weather data from weather.com and format it according to the given XSLT
# Script written by boojit
# Modified by Hellf[i]re
# The orignal script and xslt can be downloaded from http://pondol.com/weather.tar.gz

# Usage:
# ${execi 1800 /path/to/weather/weather.sh location}
# Usage Example:
# ${execi 1800 /home/user/weather/weather.sh 03833}

# your Location ID: use http://xoap.weather.com/search/search?where=[yourcity] to find it 
# U.S. users can just use their zip code; doubt that works for anyone else though (YMMV)
LOCID=$1
#LOCID=ITXX0163

# s=standard units, m=metric units
UNITS=m

# where this script and the XSLT lives
RUNDIR=/home/kbs/.conky 

# there's probably other stuff besides CURL that will work for this, but i haven't 
# tried any others. 
# you can get curl at http://curl.haxx.se/
CURLCMD=/usr/bin/curl

# get it at http://xmlsoft.org/XSLT/
XSLTCMD=/usr/bin/xsltproc

# you probably don't need to modify anything below this point....

# CURL url. Use cc=* for current forecast or dayf=10 to get a multi-day forecast
CURLURL="http://xoap.weather.com/weather/local/$LOCID?cc=*&unit=$UNITS&dayf=2"

# The XSLT to use when translating the response from weather.com
# You can modify this xslt to your liking 
XSLT=$RUNDIR/conky_weather.xslt 

#filter (if you want to convert stuff to lower-case or upper case or something)
#FILTER="|gawk '{print(tolower(\$0));}'"


#####
eval "$CURLCMD \"$CURLURL\" 2>/dev/null| $XSLTCMD $XSLT - $FILTER"



> BTW dove sei tra 2 settimane? Se sei ancora dalle parti di Amaro  
> potrei venire a
> (ri)portarti i saluti del Lug!

Sono sempre qui. Passa pure quando vuoi.
:)

-- 
produci, consuma, crepa



Maggiori informazioni sulla lista bglug