First, never underestimate the power of the execi command. I've used it for things like checking on Folding@Home unit Status, System Logs, etc. I've seen other people use it for things like monitoring weather. Incredibly powerful command.
Here's my current .torsmorc file - It's almost entirely borrowed from the Forums user who I give credit to at the top. I'm in the process of tweaking it to my liking, but when I first saw it I was like "This is what I've been trying to do for a few months", so when he posted his I decided to scrap my homemade .torsmorc and modify his (with credit, of course)
.torsmorc:
Code: Select all
# torsmo configuration
# Arainach's revisions, borrowed from Revisions by grad_guy from Gentoo Forums
# set to yes if you want tormo to be forked in the background
background no
# X font used, you can pick one with program xfontsel
#font 6x10
#font 7x13
#font 8x13
#font -*-clean-medium-r-*-*-12-*-*-*-*-*-*-*
#font -artwiz-kates-medium-*-*-*-14-*-*-*-*-*-*-*
#font -artwiz-kates-medium-*-normal-*-17-120-*-*-*-*-*-*
#font -*-webby caps-*-*-*-*-7-*-*-*-*-*-*-*
font -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso8859-1
#font -*-terminus-*-*-*-*-*-*-*-*-*-*-*-*
#font -*-bitstream vera sans mono-medium-r-*-*-12-*-*-*-*-*-*-*
# mail spool
mail_spool $MAIL
# Update interval in seconds
update_interval 3.0
# Create own window instead of using desktop (required in nautilus)
own_window no
# Minimum size of text area
minimum_size 80 5
# Draw shades?
draw_shades yes
# Draw outlines?
draw_outline no
# Draw borders naround text
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_margin 4
# border width
border_width 1
# Default colors and also border colors
#default_color spring green
default_color light blue
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
# Gap between borders of screen and text
gap_x 10
gap_y 100
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# Possible variables to be used:
#
# Variable Arguments Description
# acpiacadapter ACPI ac adapter state.
# acpifan ACPI fan state
# acpitemp ACPI temperature.
# battery (name) Remaining capasity in ACPI or APM
# battery. ACPI battery name can be
# given as argument (default is BAT0).
# buffers Amount of memory buffered
# cached Amount of memory cached
# color (color) Change drawing color to color
# cpu CPU usage in percents
# cpubar (height) Bar that shows CPU usage, height is
# bar's height in pixels
# downspeed net Download speed in kilobytes
# downspeedf net Download speed in kilobytes with one
# decimal
# exec shell command Executes a shell command and displays
# the output in torsmo. warning: this
# takes a lot more resources than other
# variables. I'd recommend coding wanted
# behaviour in C and posting a patch :-).
# execi interval, shell Same as exec but with specific interval.
# command Interval can't be less than
# update_interval in configuration.
# fs_bar (height), (fs) Bar that shows how much space is used on
# a file system. height is the height in
# pixels. fs is any file on that file
# system.
# fs_free (fs) Free space on a file system available
# for users.
# fs_free_perc (fs) Free percentage of space on a file
# system available for users.
# fs_size (fs) File system size
# fs_used (fs) File system used space
# hr (height) Horizontal line, height is the height in
# pixels
# i2c (dev), type, n I2C sensor from sysfs (Linux 2.6). dev
# may be omitted if you have only one I2C
# device. type is either in (or vol)
# meaning voltage, fan meaning fan or temp
# meaning temperature. n is number of the
# sensor. See /sys/bus/i2c/devices/ on
# your local computer.
# kernel Kernel version
# loadavg (1), (2), (3) System load average, 1 is for past 1
# minute, 2 for past 5 minutes and 3 for
# past 15 minutes.
# machine Machine, i686 for example
# mails Mail count in mail spool. You can use
# program like fetchmail to get mails from
# some server using your favourite
# protocol. See also new_mails.
# mem Amount of memory in use
# membar (height) Bar that shows amount of memory in use
# memmax Total amount of memory
# memperc Percentage of memory in use
# new_mails Unread mail count in mail spool.
# nodename Hostname
# outlinecolor (color) Change outline color
# pre_exec shell command Executes a shell command one time before
# torsmo displays anything and puts output
# as text.
# processes Total processes (sleeping and running)
# running_processes Running processes (not sleeping),
# requires Linux 2.6
# shadecolor (color) Change shading color
# stippled_hr (space), Stippled (dashed) horizontal line
# (height)
# swapbar (height) Bar that shows amount of swap in use
# swap Amount of swap in use
# swapmax Total amount of swap
# swapperc Percentage of swap in use
# sysname System name, Linux for example
# temp1 Temperature #1 from i2c-sensors, same as
# ${i2c temp 1}
# temp2 Temperature #2 from i2c-sensors, same as
# ${i2c temp 2}
# time (format) Local time, see man strftime to get more
# information about format
# totaldown net Total download, overflows at 4 GB on
# Linux with 32-bit arch and there doesn't
# seem to be a way to know how many times
# it has already done that before torsmo
# has started.
# totalup net Total upload, this one too, may overflow
# updates Number of updates (for debugging)
# upspeed net Upload speed in kilobytes
# upspeedf net Upload speed in kilobytes with one
# decimal
# uptime Uptime
# uptime_short Uptime in a shorter format
# 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
# ${color}$hr
# ${color}Mails: ${color slategrey}$mails${color} New: ${color slategrey}$new_mails${color} | ${color}Battery:${color slategrey} ${battery} %
#${color white}$nodename
#${color white}${time %A,%e %B %G %Z %H:%M:%S} ${color}UpTime: ${color white}$uptime${color}
#${color white}$sysname $kernel on $machine${color} ${color}Network:${color} Up:${color white} ${upspeed eth0} k/s${color} - Down:${color white} ${downspeed eth0} k/s
#$hr
#${color}CPU:${color white} $cpu%${color} (${color white}${loadavg 1} ${loadavg 2} ${loadavg 3}${color}) ${cpubar 5}
#${color}RAM: ${color white} $mem/$memmax - $memperc%${color} ${membar 5}
#${color}Swap:${color white} $swap/$swapmax - $swapperc%${color} ${swapbar 5}
#${color}hdb1: ${color white}${fs_used /}/${fs_size /}${color} (${color white}${fs_free_perc /}%${color} free) ${fs_bar 5/}
#${color}hda5: ${color white}${fs_used /mnt/ehdd}/${fs_size /mnt/ehdd}${color} (${color white}${fs_free_perc /mnt/ehdd}%${color} free) ${fs_bar 5/mnt/ehdd}
#${color}hdb6: ${color white}${fs_used /mnt/fhdd}/${fs_size /mnt/fhdd}${color} (${color white}${fs_free_perc /mnt/fhdd}%${color} free) ${fs_bar 5/mnt/fhdd}
TEXT
${color slate blue}${time %a, }${color }${time %B %e %G}
${color slate blue}${time %Z, }${color }${time %H:%M:%S}
$hr
${execi 40000 cal}$hr
${color slate blue}UpTime: ${color }$uptime
$hr
${color slate blue}Net :
${color}Up :${color } ${upspeed eth0} k/s
${color}Down:${color } ${downspeed eth0} k/s ${color}
$hr
${color slate blue}CPU :${color } $cpu%
$cpubar
${color slate blue}RAM :${color } $memperc% $mem/$memmax
$membar
${color slate blue}SWAP:${color } $swapperc% $swap/$swapmax
$swapbar
$hr
${color slate blue}ROOT: ${color }${fs_free_perc /}%
${fs_free /}/${fs_size /}
${fs_bar /}
${color slate blue}STUFF: ${color }${fs_free_perc /mnt/ehdd}%
${fs_free /stuff}/${fs_size /mnt/ehdd}
${fs_bar /stuff}
$hr
${color slate blue}Weather :${color}
${execi 1800 tweather.sh Today}
$hr
${color slate blue}Tomorrow :${color}
${execi 1800 tweather.sh Tomorrow}
$hrCode: Select all
#!/bin/bash
city="DeWitt"
link=USMI0231.html
file=/tmp/weather.txt
location=http://weather.yahoo.com/forecast/$link
lynx -accept_all_cookies -dump $location > $file
begin=`cat -n $file | grep "Currently" | cut -d ' ' -f5`
end=`expr $begin + 40`
head -n $end $file > tmp.t
tail -n 41 tmp.t > $file
case $1 in
Today) head -n 6 $file | sed '3d' ;;
Tomorrow)
begin=`cat -n $file | grep 'Today Tomorrow' | cut -d ' ' -f5`
end=`cat -n $file | grep 'Extended' | cut -d ' ' -f5`
num=`expr $end - $begin - 1`
end2=`expr $begin + 7`
head -n $end2 $file > tmp.t
tail -n 3 tmp.t | sed 's/sky/\n sky/' | sed '4d' ;;
*) exit ;;
esac
rm tmp.t
rm $file





