Customized XCpuload and XNet load to swallow to tray

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
kyle_white
Posts: 3
Joined: Sun 26 Jul 2009, 05:56

Customized XCpuload and XNet load to swallow to tray

#1 Post 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 :)
Attachments
xnetcpuload.jpg
(22.48 KiB) Downloaded 3153 times
xcpuload-xnetload.pet
(19.91 KiB) Downloaded 777 times

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#2 Post 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. :)
Attachments
cpu-down-up.jpg
(5.1 KiB) Downloaded 3064 times
Puppy Linux Blog - contact me for access

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#3 Post 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.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#4 Post 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.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#5 Post 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
Puppy Linux Blog - contact me for access

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#6 Post 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.
[url]https://bkhome.org/news/[/url]

kyle_white
Posts: 3
Joined: Sun 26 Jul 2009, 05:56

Source and xmemload

#7 Post 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>		
Attachments
xnetload-custom.tar.gz
(24.14 KiB) Downloaded 696 times
xcpuload-custom.tar.gz
(45.62 KiB) Downloaded 697 times
xmemload-custom.tar.gz
(34.69 KiB) Downloaded 693 times
custom-xloads.pet
(32.78 KiB) Downloaded 712 times
tray.jpg
(9.13 KiB) Downloaded 2787 times

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#8 Post by trio »

great effort, now, do you plan to modify a new one? what puppy don't have is wireless strength applet..

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#9 Post 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.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#10 Post 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>

Post Reply