< Development‎ | Tutorials
Revision as of 00:05, 20 September 2008 by Vi2 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Implementing KSysGuard sensors simple example.

Prequesities: KDE, Perl, nc

Imagine you have a program that monitors some value important for you. You want the value to be plotted or displayed in the KDE systray.

The most _____ way is to add it to KSysGuard as a sensor.

Step 1. Create, for example, "/home/vi/code/sensor/" with the following content: #!/usr/bin/perl -w $|=1;

print "ksysguardd 1.2.0\n"; print "ksysguardd> ";



print "random\tinteger\n";


if(/\?/){ print "Random Value\t0\t100\n"; }else{ print int(rand()*100),"\n"; }

   print "ksysguardd> ";


Step 2: Launch KSysGuard, File->Connect Host->Custom Command, enter "/home/vi/code/sensor/" in the Command field, OK.

Step 3: Open "", find "random Integer Value", drag it to some sheet.

You will see your sensor (random value from 0 to 100 in this case).

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal