Sigx

We are the future in the past.
It is currently Wed Dec 06, 2023 7:27 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: customCommand
PostPosted: Wed Jun 08, 2005 10:42 am 
Offline

Joined: Fri Jun 03, 2005 7:05 pm
Posts: 7
Where can i get more info on @customCommand

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 12:02 am 
Offline

Joined: Thu Dec 09, 2004 5:24 am
Posts: 140
Location: Hiding inside my laptop
I havent bothered to greatly document @customCommand, as it is an advanced feature that not many people use. ill give you an idea of how to use it (note that ive taken this config code out of v0.1.3, so its differs a bit for v0.1.2):
Code:
    set customCommand(1,shell) sh
    set customCommand(1,cmd)   {echo "hello shell!"}

so we have this first customCommand setting. we could use this to run any command you wanted. say for some weird reason you wanted to display what uptime version is installed on your machine, you can use:
Code:
    set customCommand(1,shell) sh
    set customCommand(1,cmd)   {uptime -V}

and
Code:
    set output(2) {uptime version: @customCommand(1)}

anyway, that should be enough to give you a basic idea. the reason i meantioned when you asked about displaying info about remote machines, is that you could use an ssh, rlogin, telnet or finger command to get info about other computers running on the network.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 3:10 pm 
Offline

Joined: Fri Jun 03, 2005 7:05 pm
Posts: 7
Thanks working on it now

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 08, 2005 6:35 am 
Offline

Joined: Mon Mar 07, 2005 1:53 pm
Posts: 2
In the new version customCommand doesn't work for me, too:

When you unzip the 0.1.3a-version and just change

Code:
set output (2) {Uptime: @systemUptime)}


to

Code:
set output (2) {Uptime: @customCommand(1)}


you receive the following error using ./tclsig --stdout :

Code:
Welcome to TclSigX! :-)
This program is licensed under the GNU General Public License v2
Loading Configuration (done), Code - v0.1.3
Creating Output: network, hardwareCpu, hardwareMemory, customCommand, (done)

The following errors occured while generating data items:
 * customCommand (runtime/critical): Possible bug?! Please contact TclSigX developer for support!

Outputting to stdout
----------------------------------------------------------------------------------
Memory Usage: 61% of 257mb RAM / 0% of 297mb Swap
Uptime: @customCommand(1)
CPU: AMD Athlon XP 1800+ (1.5Ghz/3.0 Kilobogomips) (29.9% usage)
Network: 645.7mb in, 304.88mb out
----------------------------------------------------------------------------------
Finished! ^_^


Oh, and btw: in dataHardware.tcl "Kila" should be changed to "Kilo" and "kila" to "kilo". Slight spelling error. ;)

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 10, 2005 7:08 am 
Offline

Joined: Thu Dec 09, 2004 5:24 am
Posts: 140
Location: Hiding inside my laptop
thanks Pontifex. Ive found the problem, and the fix is pretty simple

as this problem only affects the few users who use @customCommand, i wont be releasing a v0.1.3b to fix this problem, but it will be corrected in v0.1.4. I'm not sure when v0.1.4 will be released however, so until then, you can follow these instructions to fix v0.1.3:

1. Open data.tcl
2. Find the text:
Code:
if {(![info exists ::conf::advanced::customCommand($customCommandNum,shell)]||![info exists ::conf::advanced::customCommand($customCommandNum,cmd)])&&$customCommandNum!=0} {
    break
}

3. replace it with:
Code:
if {(![info exists ::conf::advanced::customCommand($customCommandNum,shell)]||![info exists ::conf::advanced::customCommand($customCommandNum,cmd)])} {
    if {$customCommandNum!=0} break
    incr customCommandNum
    continue
}

4. save and close data.tcl

Note - the original code will have more indenting then I've shown here, but it shouldnt make a difference if you dont have the same indenting on the replaced code.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 8:58 am 
Offline

Joined: Thu Dec 09, 2004 5:24 am
Posts: 140
Location: Hiding inside my laptop
looks like there is are more bugs in the customCommand code than just the one I found. it will be fixed in v0.1.4, so users of @customCommand will just have to wait for that.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 11:27 pm 
Offline

Joined: Sun Nov 13, 2005 7:32 am
Posts: 6
Just wanted to say thanks for this script. I eagerly await for a front end although having spent 2hrs with gedit, it wasn't that hard at all.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 12:10 am 
Offline

Joined: Sun Nov 13, 2005 7:32 am
Posts: 6
Bug?

The uptime shows as 0 hour and blank minute. I had to manually use this command for it to show on my sigs.

./tclsigx.tcl --stdout

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 12, 2005 8:37 pm 
Offline

Joined: Sun Nov 13, 2005 7:32 am
Posts: 6
I think this script has the most options, but the script doesn't show up correctly on macs :)

=============
Code:
Memory Usage: @hardwareMemoryUsedPercentPhysical of @hardwareMemoryTotalPhysical RAM
Uptime: 1 day, 11 hours 59 minutes
CPU: @hardwareCpuSummary (@hardwareCpuUsage usage)
Network: @networkInputBytes in, @networkOutputBytes out

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Fatal: Not able to open ./cache/data_global.php