Alright, I'll join in the fun.
start_conkysh
Code:
#!/bin/bash
sleep 4 &&
exec conky -d -c ~/conky/conkyrc_main &
sleep 2 &&
exec conky -d -c ~/conky/conkyrc_weather &
exit
conkyrc_main
Code:
# set to yes if you want Conky to be forked in the background
background no
cpu_avg_samples 2
net_avg_samples 2
out_to_console no
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
own_window no
own_window_transparent no
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
xftfont Liberation Mono Italic:size=8
uppercase no
# Text alpha when using Xft
xftalpha 0.8
# Update interval in seconds
update_interval 1
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 10
# border margins
border_margin 4
# border width
border_width 1
# Text alignment, other possible values are commented
#minimum_size 10 10
gap_x 13
gap_y 45
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer yes
# Subtract file system buffers from used memory?
no_buffers yes
# ideas that I didn't want to lose
# ${time %a %b %d}${alignr -25}${time %k:%M}
# Public IP ${color #DBCB97}${execi 60 wget -O - http://whatismyip.org/ | tail}
TEXT
${alignc}${color #8B7937}$sysname kernel $kernel
${alignc}${color #8B7937}on $machine host $nodename
${color #8B7937}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'} ${color #DBCB97} ${freq_dyn}Mhz
${color #8B7937}Current CPU usage & temp:${color #DBCB97} ${cpu}%${color #8B7937}, ${color #DBCB97}${acpitemp}C ${color #8B7937}/${color #DBCB97} ${acpitempf}F
${color #8B7937}Plug/battery status:${color #DBCB97} $acpiacadapter, $battery
${color #8B7937}Load average:${color #DBCB97} $loadavg
${color #8B7937}CPU usage ${alignr}PID CPU% MEM%
${color #DBCB97} ${top name 1}${alignr}${top pid 1} ${top cpu 1} ${top mem 1}
${color #DBCB97} ${top name 2}${alignr}${top pid 2} ${top cpu 2} ${top mem 2}
${color #DBCB97} ${top name 3}${alignr}${top pid 3} ${top cpu 3} ${top mem 3}
${color #8B7937}Mem usage
${color #DBCB97} ${top_mem name 1}${alignr}${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color #DBCB97} ${top_mem name 2}${alignr}${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${color #DBCB97} ${top_mem name 3}${alignr}${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${color #8B7937}RAM Usage:${color #DBCB97} $mem/$memmax - $memperc% $membar
${color #8B7937}Swap Usage:${color #DBCB97} $swap/$swapmax - $swapperc% ${swapbar}
${color #8B7937}Processes:${color #DBCB97} $processes ${color #8B7937}Running:${color #DBCB97} $running_processes ${color #8B7937}
${color #8B7937}Hard disks:
/ ${color #DBCB97}${fs_used /}/${fs_size /} ${fs_bar /}
${color #8B7937}/home ${color #DBCB97}${fs_used /home}/${fs_size /home} ${fs_bar /home}
${color #8B7937}Wireless Networking:
${color #8B7937}${exec iwconfig eth1 | grep "ESSID" | cut -c 25-60}
${color #8B7937}Local IP ${color #DBCB97}${addr eth1} ${color #8B7937}
${color #8B7937}total download: ${color #DBCB97}${totaldown eth1}
${color #8B7937}total upload: ${color #DBCB97}${totalup eth1}
${color #8B7937}download speed: ${color #DBCB97}${downspeed eth1} k/s${color #DBCB97} ${color #8B7937} upload speed: ${color #DBCB97}${upspeed eth1} k/s
${color #DBCB97}${downspeedgraph eth1 15,150 ff0000 0000ff} $alignr${color #DBCB97}${upspeedgraph eth1 15,150 0000ff ff0000}
${color #8B7937}Wired Networking:
${color #8B7937}Local IP ${color #DBCB97}${addr eth0} ${color #8B7937}
${color #8B7937}total download: ${color #DBCB97}${totaldown eth01}
${color #8B7937}total upload: ${color #DBCB97}${totalup eth0}
${color #8B7937}download speed: ${color #DBCB97}${downspeed eth0} k/s${color #DBCB97} ${color #8B7937} upload speed: ${color #DBCB97}${upspeed eth0} k/s
${color #DBCB97}${downspeedgraph eth0 15,150 ff0000 0000ff} $alignr${color #DBCB97}${upspeedgraph eth0 15,150 0000ff ff0000}
${color #8B7937}Port(s) / Connections:
${color #8B7937}Inbound: ${color #DBCB97}${tcp_portmon 1 32767 count} ${color #8B7937}Outbound: ${color #DBCB97}${tcp_portmon 32768 61000 count} ${color #8B7937}Total: ${color #DBCB97}${tcp_portmon 1 65535 count}
${color #8B7937}Outbound Connection ${alignr} Remote Service/Port${color #DBCB97}
${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
conkyrc_weather
Code:
# set to yes if you want Conky to be forked in the background
background no
cpu_avg_samples 2
net_avg_samples 2
out_to_console no
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#own_window no
#own_window_transparent no
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
xftfont Liberation Mono Italic:size=8
uppercase no
# Text alpha when using Xft
xftalpha 0.8
# Update interval in seconds
update_interval 1
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 10
# border margins
border_margin 4
# border width
border_width 1
# Text alignment, other possible values are commented
#minimum_size 10 10
gap_x 13
gap_y 40
#alignment top_left
#alignment top_right
alignment bottom_left
#alignment bottom_right
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer yes
# Subtract file system buffers from used memory?
no_buffers yes
TEXT
${color #8B7937}Local weather:
${color #DBCB97} ${execi 1800 /home/matt/conky/weather.sh MOXX0003}
weather.sh
Code:
#!/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
# Modified again by matthew
# 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 (Fes, Morocco):
# ${execi 1800 /home/user/weather/weather.sh MOXX0003}
# 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
# s=standard units, m=metric units
UNITS=s
# where this script and the XSLT lives
RUNDIR=/home/matt/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/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"
weather.xslt
Code:
<!--
This XSLT is used to translate an XML response from the weather.com
XML API.
You can format this file to your liking. Two things you may feel
like doing:
1) Modify the layout of the fields or static text already defined
2) Add other fields from the XML response file that aren't referenced in this
XSLT. You can grab a full list by just doing a:
wget "http://xoap.weather.com/weather/local/$LOCID?cc=*&unit=$UNITS"
(change $LOCID and $UNITS to suit your needs)
File modified by matthew
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:output method="text" disable-output-escaping="yes"/>
<xsl:template match="weather">
<xsl:apply-templates select="cc"/>
<xsl:apply-templates select="dayf/day[@d='1']"/>
</xsl:template>
<xsl:template match="cc">
<xsl:value-of select="obst"/>
<xsl:text> at </xsl:text><xsl:value-of select="lsup"/><xsl:text>
</xsl:text>
<xsl:text> Temperature: </xsl:text><xsl:value-of select="tmp"/><xsl:value-of select="/weather/head/ut"/>
<xsl:if test="tmp != flik">
<xsl:text>
Feels Like: </xsl:text><xsl:value-of select="flik"/><xsl:value-of select="/weather/head/ut"/>
</xsl:if>
<xsl:text>
Conditions: </xsl:text><xsl:value-of select="t"/>
<xsl:text>
Wind: </xsl:text>
<xsl:choose>
<xsl:when test="wind/s = 'calm'"><xsl:text>0</xsl:text></xsl:when>
<xsl:otherwise><xsl:value-of select="wind/s"/></xsl:otherwise>
</xsl:choose>
<xsl:value-of select="/weather/head/us"/>
<xsl:choose>
<xsl:when test="wind/s = 'calm'"><xsl:text>(0mph)</xsl:text></xsl:when>
<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
</xsl:choose>
<xsl:text> (</xsl:text><xsl:value-of select="wind/t"/><xsl:text>)</xsl:text>
<xsl:text>
Humidity: </xsl:text><xsl:value-of select="hmid"/><xsl:text> %
Barometer: </xsl:text><xsl:value-of select="bar/d"/>
</xsl:template>
<xsl:template match="dayf/day[@d='1']">
<xsl:text>
Tomorrow: </xsl:text><xsl:value-of select="low"/><xsl:value-of select="/weather/head/ut"/>
<xsl:text> to </xsl:text><xsl:value-of select="hi"/><xsl:value-of select="/weather/head/ut"/>
<xsl:text>, </xsl:text><xsl:value-of select="part[@p='d']/t"/>
<xsl:text>
</xsl:text><xsl:value-of select="/weather/swa/a/t"/>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Bookmarks