pUPnGO - 6Mb ISO - Basic Building Block Puplet

A home for all kinds of Puppy related projects
Message
Author
goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#331 Post by goingnuts »

technosaurus wrote: BTW I compiled an x11 only mrxvt with tab support and patched it to number the tabs instead of just calling them Terminal by default..
Any chance that you would post this?

To follow up on one of your many ideas I have made a small program for showing a xpm-image in the tray. Can be used to make custom tray-monitors - ex. xload. Image to use can be controlled from a shell script changing the symlink to a fixed named xpm-image. The program (pmmon - size 10K) takes the following switches:

Code: Select all

-b "bgcolour"    Window bg colour, ex. "LightGray"
-d <disp>        Set the display
-i "image"         Full path to image to show
-l "command"   Command to execute on left button mousekey press
-m "command" Command to execute on midt button mousekey press
-r "command"   Command to execute on right button mousekey press
-u <seconds>  Set update interval (default 0.5)
-h, --help          Display this help text and exit
so all mouse bottoms can be programmed to launch individual other bins.
Ex: pmmon -i "/usr/bin/f0.xpm" -l "rxvt -e top" -r "rxvt -e ps"

Attached a very simple example to replace xload.
Just include the following in /root/.jwmrc-tray

Code: Select all

<Swallow name="pmmon" width="34">
load.sh
</Swallow>
in the appropriate section...
NB: The example wont run correct in pupngo as script uses "bc" which is not present.
Slightly annoyed by above...replace load.sh code with below code:

Code: Select all

#!/bin/ash
pmmon -i "/usr/bin/f0.xpm" -l "rxvt -e top" -r "rxvt -e ps" &
while :; do
CPUHIGH=$(cat /proc/loadavg | cut -d " " -f1 | cut -d "." -f1)
[ $CPUHIGH -ge 2 ] && ln -sf /usr/bin/red.xpm /usr/bin/f0.xpm
[ $CPUHIGH -lt 2 ] && [ $CPUHIGH -ge 1 ] && ln -sf /usr/bin/yellow.xpm /usr/bin/f0.xpm
[ $CPUHIGH -lt 1 ] && ln -sf /usr/bin/green.xpm /usr/bin/f0.xpm
sleep 10
done
...knowing that its not actually cpu-load but "xload"...
Attachments
pmmon-0.1.tar.gz
pmmon-0.1 including example of primitive xload replacement
(3.95 KiB) Downloaded 335 times

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#332 Post by technosaurus »

I downloaded opera mini so I should be able to post pets now

try this
awk '{print $1}' /proc/loadavg

cut can be very difficult to maintain for /proc stuff due to kernel changing the pretty print ... tr -s can help, but I've learned the hard way that awk was designed for these exact situations

love the new tool though, I'd like to check out how hard it would be to allow multiple different images (to handle all of the tracking in one applet & cut down resource usage)
I think I posted all of my /proc hacks in jemimah's vattery thread (to get all sorts of info)... back when I was still trying to use cut also

here is a snippet of c that I use to shift the input parameters
#define shift(i,a) ({ int j=0; while(a[j] != NULL){a[j]=a[j+i];j++;})
it works best with a fixed number of parameters, otherwise you have to do checks.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#333 Post by goingnuts »

Thanks for the awk-tip! Do not expect pmmon to be bug-free - it seems that one instance running is ok - but more do not work. Think jwm only like to swallow one app. by name(?) - maybe a switch to name the child might work. Rename does not. And app. name is at the moment hard coded in pmmon - I´ll try to improve on that.
Update: Attached version takes appname and refuse to run if no image path is given. Also reduced size to 7K. Made the attached pmabs - a simple volume indicator - now able to run several pmmon and get them swallowed. Right-click mute/unmute - left-click launch xmixer if installed.
Attachments
pmabs-0.1.tar.gz
tray-applet for volume. included static build of aumix.
(28.25 KiB) Downloaded 299 times
pmmon-0.2.tar.gz
(3.31 KiB) Downloaded 313 times

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#334 Post by technosaurus »

posting mrxvt + others I forgot?

I was actually hoping that we could somehow loop through the args in c to have multiple images side by side...thus only need 1 instance of the program for monitoring multiple parameters. I may have to dig out the old x11 programming manual I found in a recycling bin.

in jemimah's words this would be a hack on top of an already dirty cludge... found the link to the procinfo stuff though
murga-linux.com/puppy/viewtopic.php?t=50696
Attachments
mrxvt-0.5.4-small.pet
(72.91 KiB) Downloaded 543 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#335 Post by goingnuts »

I was actually hoping that we could somehow loop through the args in c to have multiple images side by side..
That should be possible I think - I will work on it. Thanks for the posted programs! Attached the source code for pmmon - need to implement kill of running pmmon when restart jwm to prevent multible instances. Also need to find a way to have the background colour transfered to the icon background. A replacement for the system call (as it pause running pmmon) would be nice...
Update: The kill of running pmmon can be done from script and the pause of pmmon when calling system can be overcome by issuing command with "&" in the end - ex:

Code: Select all

pmmon -n "pmabs" -i "/usr/bin/f1.xpm" -l "xmixer &" -r "mute &" &
Attachments
pmmon-0.2-source.tar.gz
pmmon-0.2 source
(2.22 KiB) Downloaded 281 times

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#336 Post by technosaurus »

when apps are started from jwm, they appear to use an extra shell to execute the command (the shell stays running == extra resources) - this code is in command.c {toward the end} I may try to use my program forking (fork, exec, {wait?}) macro to replace it, but concerned if they would get stuck open on shutdown this way ... I would use "system(cmd)" but IIRC it may be a security concern
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#337 Post by goingnuts »

The mrxvt is tremendous! Thanks!

Posted an updated (downgrade) of xfm here - really a nice GUI file and application-manager in only 150K.

Concerning the pmmon I think a system call works fine - have tried to use the fork/exec but with no luck. Been pulling my hair out to try getting a transparent icon - but again with no luck. Thought that info here could give a break through but I am coding like a blind. :cry:

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#338 Post by technosaurus »

in an xpm you can set a color to be transparent by leaving its character value null

see percentbar and genhbar in bashbox
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#339 Post by technosaurus »

keep in mind I have only had 1 semester of c 15 years ago, but it seems like multiple applets should be case for a struct
ex. (not using c syntax)

j=0
for i=1 ... argc
if argv="-i"
applet.icon[j]=argv[i+1] //usr/lib this the right way?
applets.cmd[j]=argv[i+2]
add to total width
change height if > existing
j++
...

...
i=0
while true
for i=0 ... j
<draw> applet.*

...beter yet maybe use this xcb based code
http://vincentsanders.blogspot.com/2010 ... -hard.html

Edit - I wanted to apologize for the bashbox pet - I didn't test it before posting and the mixnmatch functions had some issues in ash - feel free to tear it apart for the functions though (in /etc/bbfsxns.sh) ... I am in the process of pulling out or rewriting (and simplifying) the desktop apps ... trying to use $DIALOG where possible (so they work in the console OR the desktop), but it either needs to be a wrapper or I need to patch and recompile dialog and Xdialog to use similar functions and probably have a no-op function for non-implemented functions from the sister app
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#340 Post by goingnuts »

technosaurus: You might have a look at my dialogfunctions.

While waiting for a break-through getting icons to show up with background colour as set in the pmmon-app. here is a workaround/different approach: pmfree2 is driven by a script that controls the xpm-icon that pmmon is to show. It requires some coding to create xpm like that on-the-fly but the master-xpm could be made more universal and handle xload, network, audio, battery etc. and you really can set your internal icon-designer free...
An upcoming pmmon5 is under creation - handles 5 icons at once...
Attachments
pmfree2.png
image of the running pmfree2 (outer left image....)
(2.83 KiB) Downloaded 1236 times
pmfree2.pet
pmfree2 alternative to freememapplet. xpm created in ash-script and shown by pmmon
(6.15 KiB) Downloaded 266 times

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

pmmon5 release

#341 Post by goingnuts »

pmmon5 (16K) is a image projector/application launcer for jwm tray. It shows the 5 xpm-images placed in /tmp/ (p1.xpm, p2.xpm, p3.xpm, p4.xpm and p5.xpm). All 3 mouse buttons can be programmed to act on each image. So use the symlink method (symlink whatever image you want showed to the mentioned xpm-files in /tmp) or use a script to generate the images. Attached an example of the later to replace xload, freememapplet, blinky, asapm and absvolume.
Configure the mouse actions in the pmmon5.sh script. In the pet also static version of aumix and xmixer (on which the volume is programmed to depend on).
Include the following in /root/.jwmrc-tray to have jwm swallow the application:

Code: Select all

<Swallow name="pmmon5" height="35">
pmmon5.sh
</Swallow>
The pmmon5 application has very few dependencies (c,X11, Xpm, Xau, Xdmcp) so resource demand is minimal compared to the above mentioned tray-apps.
For further configuration options type pmmon5 -h at a command prompt...
Attachments
pmmon5_source.tar.gz
source for pmmon5...
(3.1 KiB) Downloaded 263 times
pmmon5.png
running the attached pet
(4.71 KiB) Downloaded 1040 times
pmmon5.pet
pmmon5 bin, pmmon5.sh script, aumix and xmixer
(52.45 KiB) Downloaded 256 times

wanderer
Posts: 1098
Joined: Sat 20 Oct 2007, 23:17

unable to open initrd.gz

#342 Post by wanderer »

don't know what i am doing wrong

tried to open initrd.gz with cpio

but this did not work

works ok on

431 initrd

dpup initrd

any help appreciated

thanks

wanderer

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#343 Post by technosaurus »

@goingnuts - looks pretty good, can't wait to play with it on my puppy box... probably swallowed in a standalone autohide tray.

@wanderer
is the initrd lzma'd or gripped? ... whichever it is you need that + cpio to extract the initial ramdisk. (either zcat or lzmacat...¦...)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#344 Post by sc0ttman »

goingnuts, pmmon5 looks great... I will try it out as soon as I can...

I would like to use it to replace pmconky (perhaps... I will experiment)

I'm not asking you to do this, I will try myself, but do you think it would be possible to include the following:
- CPU temperature
- kbs up/down

I might use this in a separate tray, like technosaurus, popping out over the normal taskbar, right hand side, something like "Damn Small Linux"...
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#345 Post by goingnuts »

@wanderer: The initrd.gz is lzma despite the extension.
@technosaurus: Thanks - and thank you for the inspiration to this!
@sc0ttman: Thanks :). Should be possible - the temp easier that the up/down I think. The function "digit2xpm" in pmmon5.sh takes 3 digits and convert to xpm-digits. Just add a function to make a new UNIT (oC og oF) for the temperature...

Forgot to include the mute script in the pet - just make a script in /usr/bin with the following code:

Code: Select all

#! /bin/sh
# $Aumix: aumix/src/mute,v 1.2 2010/04/28 23:30:37 trevor Exp $
# Copyright (c) 2001, Ben Ford and Trevor Johnson
#
# Run this script to mute, then again to un-mute.
# Note:  it will clobber your saved settings.
#
volumes=$(aumix -vq |tr -d ,)
if [ $(echo $volumes | awk '{print $2}') -ne 0 -o \
	$(echo $volumes | awk '{print $3}') -ne 0 ]; then
	aumix -S
	aumix -v 0
else
	aumix -L > /dev/null
fi
and right click on the volume should mute/unmute.
I sometime see that volume and free do not start properly and a restart of jwm fix this. Think timings in script can be fine-tuned or do a check for some relevant content present in the created xpm-files [ex. grep "/* XPM */" /tmp/p1.xpm] before bypassing generation of an updated image.

The power/battery measure charge percent against "design capacity"...if you never reach 100% charged - that's the reason. I think other battery-monitors uses "last full capacity" as base-line which hide your battery's decreasing capacity... One can "zero" the battery memory by de-charging total, take out the battery and after that charge for 24h. Your charge capacity will normally increase after that...

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#346 Post by technosaurus »

#scottman CPU temp may need a separate parameter to change color, but the temp itself and kb up/down is pretty easy to do... as far as going over a taskbar, jwm has this weird nuance where horizontal trays only work correctly at the top and bottom and vertical trays only work on the sides (the tray will hide in the wrong place) ...I couldn't find the code that causes it.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#347 Post by goingnuts »

What should become of pupngo? I feel pupngo is close to mature and only small issues to be modified/added. Pupngo can run xwoaf, basiclinux, mulinux, dsl, tinycore, slitaz, INX, puppy 108-431 on top of it. It handles sfs, tgz, pet, dep, rpm etc. for extensions. Most important wizards run CLI/GUI. Load and save options of original puppy is working.

Only a few seems to use it for single application purpose or embedded systems which was the original target.

Plans of separating the kernel-modules from initrd.gz not fulfilled. Easy kernel shift not implemented. But does this serve any purpose?

Guess some "innovative" items popped up during the development of pupngo, I know it has been really fun and educational for myself to make it - but whats next?

With Baby-Linux upcoming, thoughts and ideas in the Saluki thread - what can/should be the room where pupngo add value?

Any comments welcome but I think I´ll take a break and not chase small incremental improvements to the 80:20 finished pupngo.

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#348 Post by starhawk »

I'd like to see a version of pUPnGO that could be used on really old systems (like that K6 heap of mine), where it was already configured for simple office tasks, but at its considerably dinky size, so that systems that old could still be made useful.

--off-topic-- XWOAF is great! But it doesn't boot on my 486 w/o math coprocessor. Is there an easy way to emulate that within XWOAF, or am I asking too much (no worries if I am, just wanted to be able to point and laugh at Linux on a 486 in this day & age...)

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#349 Post by technosaurus »

486sx is _really_ obscure ... needs a kernel recompile to emulate the mmu and makes other architectures significantly slower... there was eboxpup, but I can't seem to find the ISO ... the architecture is still produced though (vortex86sx @ up to 800mhz iirc)

I've thought about doing a couple of things:
building all the apps into a single static multicall binary
a uclibc & uclibc++ or musl & stlport build (dietlibc has license issues)
porting all pupngo scripts to bashbox
reworking init using resource levelling for fastest critical path to minimal X... backgrounding the rest, but shift X basics to the initrd (+ 1mb)
compile a static webkit browser for the framebuffer
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#350 Post by starhawk »

I thought Vortex86 was a 5x86...? Could be wrong... been awhile since I looked at that, since the RoBoard 110* is a little much for my wallet (and my skillset).

*RoBoard 110 is a PicoITX motherboard designed for robotics applications. It's pretty fancy stuff, yo.

Post Reply