Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 23 Sep 2014, 02:32
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
pUPnGO - 6Mb ISO - Basic Building Block Puplet
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 23 of 58 [868 Posts]   Goto page: Previous 1, 2, 3, ..., 21, 22, 23, 24, 25, ..., 56, 57, 58 Next
Author Message
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Sun 20 Mar 2011, 05:15    Post subject:  

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:

-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:

<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:

#!/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"...
pmmon-0.1.tar.gz
Description  pmmon-0.1 including example of primitive xload replacement
gz

 Download 
Filename  pmmon-0.1.tar.gz 
Filesize  3.95 KB 
Downloaded  184 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sun 20 Mar 2011, 14:06    Post subject:  

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.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Sun 20 Mar 2011, 15:02    Post subject:  

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.
pmabs-0.1.tar.gz
Description  tray-applet for volume. included static build of aumix.
gz

 Download 
Filename  pmabs-0.1.tar.gz 
Filesize  28.25 KB 
Downloaded  195 Time(s) 
pmmon-0.2.tar.gz
Description 
gz

 Download 
Filename  pmmon-0.2.tar.gz 
Filesize  3.31 KB 
Downloaded  195 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sun 20 Mar 2011, 21:45    Post subject:  

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
feh-1.10.1-i486.pet
Description  needs imlib2
pet

 Download 
Filename  feh-1.10.1-i486.pet 
Filesize  317.18 KB 
Downloaded  196 Time(s) 
bashbox-0.5.2.pet
Description 
pet

 Download 
Filename  bashbox-0.5.2.pet 
Filesize  241.86 KB 
Downloaded  201 Time(s) 
mrxvt-0.5.4-small.pet
Description 
pet

 Download 
Filename  mrxvt-0.5.4-small.pet 
Filesize  72.91 KB 
Downloaded  307 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Mon 21 Mar 2011, 01:48    Post subject:  

Quote:
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:
pmmon -n "pmabs" -i "/usr/bin/f1.xpm" -l "xmixer &" -r "mute &" &
pmmon-0.2-source.tar.gz
Description  pmmon-0.2 source
gz

 Download 
Filename  pmmon-0.2-source.tar.gz 
Filesize  2.22 KB 
Downloaded  179 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Mon 21 Mar 2011, 11:31    Post subject:  

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
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Mon 21 Mar 2011, 15:41    Post subject:  

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. Crying or Very sad
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Mon 21 Mar 2011, 16:05    Post subject:  

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

see percentbar and genhbar in bashbox

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Mon 21 Mar 2011, 18:38    Post subject:  

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]="-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.*[i]

...beter yet maybe use this xcb based code
http://vincentsanders.blogspot.com/2010/04/xcb-programming-is-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

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Sun 27 Mar 2011, 09:52    Post subject:  

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...
pmfree2.png
 Description   image of the running pmfree2 (outer left image....)
 Filesize   2.83 KB
 Viewed   1173 Time(s)

pmfree2.png

pmfree2.pet
Description  pmfree2 alternative to freememapplet. xpm created in ash-script and shown by pmmon
pet

 Download 
Filename  pmfree2.pet 
Filesize  6.15 KB 
Downloaded  169 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Mon 04 Apr 2011, 10:54    Post subject: pmmon5 release  

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:

<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...
pmmon5_source.tar.gz
Description  source for pmmon5...
gz

 Download 
Filename  pmmon5_source.tar.gz 
Filesize  3.1 KB 
Downloaded  158 Time(s) 
pmmon5.png
 Description   running the attached pet
 Filesize   4.71 KB
 Viewed   960 Time(s)

pmmon5.png

pmmon5.pet
Description  pmmon5 bin, pmmon5.sh script, aumix and xmixer
pet

 Download 
Filename  pmmon5.pet 
Filesize  52.45 KB 
Downloaded  158 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
wanderer

Joined: 20 Oct 2007
Posts: 229

PostPosted: Mon 04 Apr 2011, 22:00    Post subject: unable to open initrd.gz  

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
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Mon 04 Apr 2011, 22:25    Post subject:  

@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...¦...)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Tue 05 Apr 2011, 07:20    Post subject:  

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"...

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Tue 05 Apr 2011, 12:41    Post subject:  

@wanderer: The initrd.gz is lzma despite the extension.
@technosaurus: Thanks - and thank you for the inspiration to this!
@sc0ttman: Thanks Smile. 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:

#! /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...
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 23 of 58 [868 Posts]   Goto page: Previous 1, 2, 3, ..., 21, 22, 23, 24, 25, ..., 56, 57, 58 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

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
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1159s ][ Queries: 13 (0.0163s) ][ GZIP on ]