My setup.
My conky config files:
conkyrc
Code:
# 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
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer yes
use_xft no
# Update interval in seconds
update_interval 1.0
# Minimum size of text area
# minimum_size 250 5
# Draw shades?
draw_shades no
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
font arial
uppercase no # set to yes if you want all text to be in uppercase
# Stippled borders?
stippled_borders 3
# border margins
border_margin 0
# border width
border_width 0
# Default colors and also border colors, grey90 == #e5e5e5
#default_color slate grey
default_color white
own_window_colour brown
own_window_transparent yes
# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
gap_x 7
gap_y 17
# set to 1 to diable
cpu_avg_samples 2
# 994F10
# stuff after 'TEXT' will be formatted on screen
TEXT
${color #32424F}CPU0: ${cpu cpu1}%${color #89BFD7} / ${color #32424F}CPU1: ${cpu cpu2}%${color #89BFD7} / ${color #32424F}RAM: $memperc% ${color #89BFD7}/${color #32424F} Disk: ${fs_free_perc /} % ${color #89BFD7}/${color #32424F} Battery: ${execi 10 ~/scripts/acpi/acpi.sh} ${color #89BFD7}/${color #32424F} ${execi 5 ~/scripts/acpi/acpi_full.sh} ${color #89BFD7}/${color #32424F} ${execi 30 acpi -B -t -f | cut -c21-25}F
conkyrc_weather
Code:
# 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
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer yes
use_xft no
# Update interval in seconds
update_interval 1.0
# Minimum size of text area
# minimum_size 250 5
# Draw shades?
draw_shades no
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
font arial
uppercase no # set to yes if you want all text to be in uppercase
# Stippled borders?
stippled_borders 3
# border margins
border_margin 0
# border width
border_width 0
# Default colors and also border colors, grey90 == #e5e5e5
#default_color slate grey
default_color white
own_window_colour brown
own_window_transparent yes
# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
gap_x 7
gap_y -10
# set to 1 to diable
cpu_avg_samples 2
# 994F10
# stuff after 'TEXT' will be formatted on screen
TEXT
${color #3D738E}${execi 300 /home/kevin/scripts/conky/weather_bool.sh}
The scripts I use:
conky.sh (used to load both instances of conky)
Code:
#!/bin/bash
sleep 1 &&
conky -d -c /home/kevin/scripts/conky/conkyrc &&
sleep 2 &&
conky -d -c /home/kevin/scripts/conky/conkyrc_weather &
exit
acpi.sh (get the battery charge percentage. I didn't like the built in version)
Code:
#!/bin/bash
acpi_output="$(acpi -b)"
case "$acpi_output" in
*discharging*)
case "$acpi_output" in
*100*) echo $acpi_output | cut -c25-28;;
*) echo $acpi_output | cut -c25-27;;
esac
;;
*)
case "$acpi_output" in
*100*) echo $acpi_output | cut -c21-25;;
*) echo $acpi_output | cut -c22-24;;
esac
;;
esac
acpi_full.sh (used to show charging/discharging time.. again, I didn't like the built in version)
Code:
#!/bin/bash
acpi_output="$(acpi -b)"
case "$acpi_output" in
*charged,*) time="+00:00";;
*information*) time="*00:00";;
*discharging*)
case "$acpi_output" in
*100*) time="-$(echo $acpi_output | cut -c31-35)";;
*) time="-$(echo $acpi_output | cut -c30-34)";;
esac
;;
*charging*) time="+$(echo $acpi_output | cut -c27-31)";;
esac
echo $time
weather.sh (used to pull the weather)
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
# 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=GMXX0020
# s=standard units, m=metric units
UNITS=s
# where this script and the XSLT lives
RUNDIR=/home/kevin/scripts/conky/weather
# 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"
#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_bool.sh (if your offline and can't pull the weather this will tell you..)
Code:
#!/bin/bash
output="$(/home/kevin/scripts/conky/weather/weather.sh)"
case "$output" in
*,*) echo $output;;
*) echo "Weather currently unavailable.";;
esac
weather.xslt (used to translate the weather)
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)
-->
<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:text></xsl:text><xsl:value-of select="tmp"/><xsl:value-of select="/weather/head/ut"/>
<!--<xsl:if test="tmp != flik"><xsl:text></xsl:text><xsl:value-of select="flik"/><xsl:value-of select="/weather/head/ut"/></xsl:if>-->
<xsl:text>, </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:value-of select="round(wind/s * 0.6214)"/><xsl:text>mph)</xsl:text></xsl:otherwise>
</xsl:choose>
<xsl:text> (</xsl:text><xsl:value-of select="wind/t"/>
<xsl:text>)</xsl:text>-->
</xsl:template>
<xsl:template match="dayf/day[@d='1']">
<xsl:text> > </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