Genmon

About

First written by Roger Seguin, this plugin cyclically spawns the indicated script/program, captures its output (stdout) and displays the resulting string into the panel.

The new version can also displayed an image, a bar, a button and a personalized tooltip.

Usage

If you want the plugin to display only text (original version), enter the command in the Command field of the Property section of the plugin.

If you want the plugin to display personalized Image or Tooltip or Bar or Button (new version), you should develop (or get) a script returning a XML string, and enter the path of this script in the Command field of the Property section of the plugin.

The XML tags which can be used:

  • <txt>Text to display</txt>
  • <img>Path to the image to display</img>
  • <tool>Tooltip text</tool>
  • <bar>Pourcentage to display in the bar</bar>
  • <click>The command to be executed when clicking on the image</click>

If None of the tags are detected in the result of the command, the plugin returns to its original behaviour (displaying the result of the command).

Here’s a simple example of a plugin displaying the Temp of the CPU in the panel (with an icon) and the Freq in a Tooltip:

#!/bin/bash
echo "<img>/usr/share/icons/Bluecurve/16x16/apps/gnome-monitor.png</img>"
declare -i cpuFreq
cpuFreq=$(cat /proc/cpuinfo | grep "cpu MHz" | sed 's/\ \ */ /g' | cut -f3 -d" " | cut -f1 -d".")
if [ $cpuFreq -ge 1000 ]
then
  cpu=$(echo $cpuFreq | cut -c1).$(echo $cpuFreq | cut -c2)GHz
else
  cpu=${cpuFreq}MHz
fi
echo "<txt>"$(cat /proc/acpi/thermal_zone/THM/temperature | sed 's/\ \ */ /g' | cut -f2 -d" ")" C</txt>"
echo "<tool>Freq: "$cpu"</tool>"

PS: Depending on your configuration, you should change the image path.

Screenshots

:projects:panel-plugins:xfce4-genmon-plugin.png

In this example, the plugin is used to (from left to right):

  1. display the date
  2. mount/unmount an USB disk with 1 click
  3. display the CPU temperature (and the frequency in the tooltip)
  4. display the HD temperature
  5. display the state of the 2 batteries of my laptop
  6. display the WIFI quality

Most of the scripts are available in the plugin archive.

Releases

Version 3.2 (for Xfce 4.4)

Dependencies

FIXME

 
projects/panel-plugins/xfce4-genmon-plugin.txt · Last modified: 2009/08/30 13:19 by mmassonnet