LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Torsmo Tips & Tricks (https://www.linuxquestions.org/questions/linux-software-2/torsmo-tips-and-tricks-341905/)

Slum 07-10-2005 02:12 PM

Torsmo Tips & Tricks
 
For those of you that don't know:

What is Torsmo?

Torsmo is a system monitor that sits in the corner of your desktop. It's very simple, customizable and it renders only text on the desktop (and percentagebars if you want it to ;) and the only lib it uses is Xlib.
Torsmo can show various information about your system and it's peripherals, including:

* Kernel version
* Uptime
* System time
* Network interface information
* Memory and swap usage
* Hostname
* Machine, i686 for example
* System name, Linux for example
* Temperatures from i2c-sensors
* Temperature from ACPI
* Battery capacity from ACPI/APM
* Number of processes running or sleeping
* Local mails (unread and all)
* Filesystem stats

Let's post some tricks that we've either come across or figured out about the beloved Torsmo system monitor.

Action shot: http://slum3.tripod.com/images/shot.jpg
(copy and paste the url, tripod doesn't allow hotlinking.)

You can get Torsmo from http://torsmo.sourceforge.net

Slum 07-10-2005 02:14 PM

My .torsmorc
 
Here's my ~/.torsmorc file:
Code:

# torsmo configuration

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

# 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-*-*-*-*-*-*-*

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont verdana-11

# Text alpha when using Xft
xftalpha 0.8

# mail spool
mail_spool $MAIL

# Update interval in seconds
update_interval 2.0

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

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

# Minimum size of text area
minimum_size 280 5

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 8

# border margins
border_margin 4

# border width
border_width 1

# 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

# Gap between borders of screen and text
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

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

# stuff after 'TEXT' will be formatted on screen

TEXT
${color grey}CPU Usage:$color
  $cpu% ${cpubar 6}
${color grey}RAM Usage:$color $mem/$memmax
  $memperc% ${membar 6}
${color grey}Swap Usage:$color $swap/$swapmax
  $swapperc%  ${swapbar 6}
${color grey}HDD: $color${fs_free /}/${fs_size /}
  $fs_free_perc% ${fs_bar 6 /}
${color grey}Networking:
  Up:$color ${upspeed eth0} k/s${color grey} - Down:$color ${downspeed eth0} k/s
${color grey}Temperatures:
  CPU:$color ${exec .ctof.sh proc}F${color grey} :: MB:$color ${exec .ctof.sh mobo}F${color grey}
${color grey}Juice:
  Vcore:$color ${i2c 1-002d in 0}V
${color grey}CPU Fan:$color ${i2c 1-002d fan 1} rpm
${color grey}Uptime:$color $uptime
${color grey}Processes:$color $processes  ${color grey}Running:$color $running_processes
$hr
${color grey}Weather :${color}
${execi 1800 .tweather.sh Today}
$hr
${color grey}Tomorrow :${color}
${execi 1800 .tweather.sh Tomorrow}
$hr


Slum 07-10-2005 02:15 PM

Celcius to Fahrenheit conversion.
 
My i2c sensors were only outputting Celcius temperatures. Being that I live in the US and the Metric System is like Greek to me, I decided to write a bash script to work with Torsmo to convert those temperatures to Fahrenheit.

Here's my .torsmorc
Code:

${color grey}Temperatures:
  CPU:$color ${exec .ctof.sh proc}F${color grey} :: MB:$color ${exec .ctof.sh mobo}F${color grey}


Here's the .ctof.sh script:
Code:

#!/bin/bash

case $1 in
proc)
i=`cat /sys/bus/i2c/devices/1-002d/temp1_input`
echo "$i / 1000 * 1.8 + 32" | bc
;;
mobo)
d=`cat /sys/bus/i2c/devices/1-002d/temp2_input`
echo "$d / 1000 * 1.8 + 32" | bc
;;
*) exit;;
esac

You might have to edit the /sys/bus/i2c/devices line to match your configuration, afterwards you can test the script by running:

sh .ctof.sh mobo
sh .ctof.sh proc

Enjoy!

Slum 12-27-2005 07:04 PM

bump up...


All times are GMT -5. The time now is 10:44 PM.