Page 1 of 1

Customized XCpuload and XNet load to swallow to tray

Posted: Sun 26 Jul 2009, 06:27
by kyle_white
I've just started with puppy and love it for my laptop. One thing I wanted from other WMs is cpu, memory, and net monitors in the tray. I couldn't find any after some searching (but found information on how to swallow xload) so I made my own from XCpuload and XNetload. They were compiled on Debian Lenny, since I couldn't get xmkmf working on puppy, but they are working on my 4.21. I'm not sure if there's any dependencies which aren't in 4.21 native, if anyone figures some out they can add to this post. I've added several options to each program so they can be better formatted. Install these and put this into your .jwmrc-tray file

Code: Select all

<Swallow name="xcpuload" width="32">
      xcpuload-autoscale -nolabel -nomhz -bg lightgray -fg "#0000C0" -hl darkgray -update 1 -jumpscroll 1
</Swallow>
<Swallow name="xnld" width="32">
      ~/.xnetload-tray/xnld -nv -ni -ch 24 -s 25 -kb -nu -ms 4 wlan0
</Swallow>		
<Swallow name="xnlu" width="32">
      ~/.xnetload-tray/xnlu -nv -ni -ch 24 -s 25 -kb -nd -ms 4 wlan0
</Swallow>	


to do this I make a directory ~/.xnetload-tray and put absolute links to /usr/bin/xnetload called xnlu and xnld. This is necessary because swallow seems to swallow based on the name of the command

if you don't want to mess with sim links replace

Code: Select all

<Swallow name="xnld" width="32">
      ~/.xnetload-tray/xnld -nv -ni -ch 24 -s 25 -kb -nu -ms 4 wlan0
</Swallow>		
<Swallow name="xnlu" width="32">
      ~/.xnetload-tray/xnlu -nv -ni -ch 24 -s 25 -kb -nd -ms 4 wlan0
</Swallow>		
with

Code: Select all

<Swallow name="xnetload" width="32">
      xnetload -nv -ni -ch 12 -s 30 -kb -ms 2 wlan0
</Swallow>
P.S. - if anyone knows of a "XMemload" I'd like to get that swallowed too :)

Posted: Sun 26 Jul 2009, 07:04
by 01micko
Hello kyle_white

Yep, installed and configured all good on a puppy derivative.. spup, from BarryK's woof. One problem.. I'm running an old P111 600 and the cpu seems maxed out in the meter the whole time. Is there a way to scale this? (Is it in the options?)

Same with a 1725MHz Athlon

Cheers, nice work. :)

Posted: Sun 26 Jul 2009, 09:22
by disciple
xcpuload doesn't seem to show the CPU usage as a percentage or anything. It just shows the actual CPU clock speed. So it is only useful if you are running a laptop with frequency scaling enabled, which means that your CPU slows down when it is not busy, to save power.

Posted: Sun 26 Jul 2009, 09:27
by disciple
if anyone knows of a "XMemload" I'd like to get that swallowed too
Freememapplet does this, depending on how you are running Puppy (it usually shows the free space in the save file). So I think it should be trivial to modify it to always show free memory. Actually, if you can find the original version I think it did only show that.

Posted: Sun 26 Jul 2009, 09:27
by 01micko
disciple,
xcpuload doesn't seem to show the CPU usage as a percentage or anything. It just shows the actual CPU clock speed.
Thanks, that would explain it. Ah well, the other two are useful :)

Cheers

Posted: Sun 26 Jul 2009, 10:05
by BarryK
kyle_white,
That's great, always good to have more stuff for the tray.
Would you mind posting the modified source too, for gpl we always must have the source code available.

Source and xmemload

Posted: Wed 29 Jul 2009, 00:37
by kyle_white
I modified xcpuload into xmemload. Had some bugs for the first go round with it but it seems to be working. I just did quick hack jobs to the source of all three of the files, but I'll get them tar'd up, hacks and all, and post them soon. xmemload uses /proc/meminfo. I'm going to look at conky and the xfce applets to see if I can't fix xcpuload to use kernel information for the graph.

Edit: I've fixed up xcpuload to use info from /proc/stat and /proc/cpuinfo. Hopefully it'll work the same as conky now. I've also attached the source for each.

Here's what I have in my jwmrc-tray

Code: Select all

		<Swallow name="xcpuload" width="32">
			xcpuload -nolabel -nomhz -bg lightgray -fg "#0000C0" -hl darkgray -update 1 -jumpscroll 1
		</Swallow>
		<Swallow name="xmemload" width="32">
			xmemload -nolabel -nomb -bg lightgray -fg "#c00000" -hl darkgray -update 1 -jumpscroll 1 -scale 4
		</Swallow>
		<Swallow name="xnetload" width="32">
			xnetload -nv -ni -ch 12 -s 30 -kb -ms 4 wlan0
		</Swallow>		

Posted: Thu 30 Jul 2009, 13:08
by trio
great effort, now, do you plan to modify a new one? what puppy don't have is wireless strength applet..

Posted: Fri 31 Jul 2009, 06:41
by disciple
What everyone always wants is one to show CPU usage as a percentage... I imagine it shouldn't be too hard to do.

Posted: Wed 04 Nov 2009, 18:22
by abushcrafter
Thanks.

Can you add the option to chose which bits of text to show eg just the percentage please :)

Also so for xnetload options you need -if <INTERFACE>

so...

Code: Select all

		<Swallow name="xnetload" width="32"> 
			xnetload -nv -ni -ch 12 -s 30 -kb -ms 4 -if eth0
		</Swallow>