pStopWatch 0.6

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

pStopWatch 0.6

#1 Post by zigbert »

pStopWatch ... Xdialog clock

This is a
- Stopwatch / Timer
- (Alarm) Clock


Ptimer is a gui for pStopWatch

Sigmund Berglund

Code: Select all

# pstopwatch -h                           
Usage: pstopwatch [OPTION]

Options
	-a [command /path/file]
								alternative sound: alarm
	-A HH:MM		alarm at HOUR:MINUTE. requires -C     
	-b [command /path/file]
								alternative sound: beep low     
	-B [command /path/file]
								alternative sound: beep high     
	-c						no countdown - no sync with system time. Use with -s
	-C						start with ordinary clock. Forces -xy
	-f [font:size]	set font-type and fontsize       
	-h						show this help message
	-l [start:stop:header]
								Language support. Local variables for Start:Stop:Window-title                             
	-s						count with seconds, not tenth as default
	-t MM:SS			stopwatch alarm after MINUTES:SECONDS
	-v						show pStopWatch version
	-w X:Y				window size HORIZONTAL:VERTICAL
	-x						auto start
	-y						no stop-button. Must be killed external.

Image


Download
username: puppy
password: linux

pStopWatch-0.6 (7 kb).


Examples:
Big timer with barking

Code: Select all

pstopwatch -cyxst 00:03 -a "aplay /usr/share/audio/bark.au" -f bold:80 -w 470:120
Wake me at 7

Code: Select all

pstopwatch -CA 07:00 -l ::"Wake me at 7"
Changelog
Version 0.6 - 6.Apr 2008
- Less flicker on clock.
- Less flicker on stopwatch when tenth is not used.
- Integration with Ptimer.
- Removed menu entry in *.pet
- Bugfix: Kill external program which plays alarm.
- Bugfix: Window height in Puppy4
- Bugfix: Better parameter control
Last edited by zigbert on Thu 04 Nov 2010, 17:36, edited 12 times in total.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#2 Post by zigbert »

Things get clearer after some hours with sleep.

Version 0.2 is not SO buggy, and has got start/stop button.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post by Lobster »

Hi Sigmund

I am using pupEEE (3.01 based) and the program comes up
but there is no display (numbering)

:? Have I frozen time or entered the twighlight zone?
am assuming a missing graphic lib?

pStopWatch would be great for athletes/trainers using the Eeepc
Time your lap/effort and graph up in gnumeric . . .
Soon you will be an Olympiad athlete . . . Puppy trained!

:)
Last edited by Lobster on Wed 02 Apr 2008, 10:16, edited 1 time in total.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#4 Post by HairyWill »

aha
a project you could not do in gtkdialog
I challenge you to port it

Sorry, Sigmund the fonts do not work for me on muppy 8.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#5 Post by zigbert »

Could it be so simple that pupEEE has black text in Xdialog. (My Puppy 3.01 has dark grey.) Try to change line 21 in /usr/local/pstopwatch/pstopwatch.
from

Code: Select all

base[NORMAL]	= "#000000" }
to

Code: Select all

 base[NORMAL]	= "#FFFFFF" }
This will give white background.

Sigmund

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#6 Post by HairyWill »

Sorry, I should have been more clear. Both the text in the window and on the button is in the system default font at only 10 or 12 points high. I tried poking at the section that exports the temporary gtk settings, I could change other things but nothing I seemed to do to the font made any difference.

Wait. If you are developing this in dingo then it has no gtk1, the problem may only exist if gtk1 is installed.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#7 Post by Lobster »

zigbert wrote: from

Code: Select all

base[NORMAL]	= "#000000" }
to

Code: Select all

 base[NORMAL]	= "#FFFFFF" }
This will give white background.

Sigmund
8) that works but I am getting
multiple lines of output - see image
Attachments
sw.jpg
(15.11 KiB) Downloaded 1891 times
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#8 Post by HairyWill »

well that disproves my gtk1 theory
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#9 Post by zigbert »

HairyWill wrote:aha
a project you could not do in gtkdialog
I challenge you to port it
If you beat me with this, I would be nothing else that VERY pleased.
I guess you have an idea how much I have tried. :)
Lobster wrote: that works but I am getting
multiple lines of output
I seems that Xdialog doesn't use the size parameters in your pupEEE system. Have you tried it on another puppy?

What background color should we use, since black maybe isn't the best choice.

Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#10 Post by zigbert »

Version 0.3

The stop watch didn't start correct. Now there are a 3 sec countdown to sync with system clock.

Tested in Puppy4

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#11 Post by Lobster »

Have you tried it on another puppy?
not yet - it's barking at me (v 0.3) :?
What background color should we use, since black maybe isn't the best choice.
the text needs to be smaller or the display window bigger to get it all in. If you are working towards Dingo - then I suggest orange for now
black, white and grey are the neutral colours . . .
. . .or a variable to be configured . . .
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#12 Post by HairyWill »

just tested both 0.2 and 0.3 in dingo7
for both of them the main window appears black with no visible text, the button font is the correct size

tested both on mini-muppy 8
background is black font is just legible but the fonts come out at the system default size

without the -s parameter it is thrashing my cpu

running with fractions o
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#13 Post by zigbert »

just tested both 0.2 and 0.3 in dingo7
for both of them the main window appears black with no visible text, the button font is the correct size
I tested 0.3 on 3 different machines one alpha6, one alpha7, and one 3.01. All shows a nice stop watch. What goes wrong here? :?

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#14 Post by zigbert »

Version 0.4

- Stopping clock during countdown crashed program
- Beeps for Barks.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

a suggestion or two

#15 Post by vovchik »

Dear zigbert,

Thanks. I like the app but also ran into problems with fonts etc. (tiny, standard). One way out of the problem is to do the following after line 18 of the main script:

Code: Select all

mygtk="cat /root/.gtkrc-2.0 | grep include"
and

Code: Select all

echo '$mygtk

as the first line of the sequence that creates gtkrc_mono.

Then, only export the following:

Code: Select all

export GTK2_RC_FILES=/tmp/gtkrc_mono
This will ensure that the user's style is preserved with only the font size and colour changing.

In my case, the relevant line in /root/.gtkrc-2.0 is:

Code: Select all

include "/usr/share/themes/MacOS-X/gtk-2.0/gtkrc"
Also, I have attached two tiny wav files with nice pop sounds. I included one of them in the "Stop" part:

Code: Select all

"$APPDIR"/pstopwatch_counter &
Xdialog --title "Stop Watch" --smooth --screen-center --no-ok --cancel-label "Stop" --logbox /tmp/pstopwatch-clock 383x137
play ./pop-high.wav > /dev/null 2>&1
echo stop > /tmp/pstopwatch-status
tail /tmp/pstopwatch-clock | grep -v "^$" > /tmp/pstopwatch-clock
"$APPDIR"/pstopwatch
Again, thanks and kind regards,
vovchik
Attachments
pop-waves.tar.gz
(4.27 KiB) Downloaded 1268 times

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#16 Post by zigbert »

vovchik

Will you please post your hacked code. Since I can't reproduce the trouble, it is hard to test if my coding works.

Nice pops!

Sigmund

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Hacked script

#17 Post by vovchik »

Dear Sigmund,

Here is the hacked code. I've restructured the first script so as to be able to understand more clearly the underlying logic. While most of the changes are not salient, you can see my old-school Pascal mania resurfacing.:). I introduced, among a few vars, mygeometry - which facilitates tweaking - and sound_high and sound_low, softcoded pointers to sound files to permit easy customization, in addition to the gtkrc hack. The only change introduced in the second script, as I recall, is the softcoding of the sound file vars. Please have a look. I'm interested whether the modded code runs fine on your machine.

With kind regards,
vovchik
Attachments
pstopwatch-1.tar.gz
(1.65 KiB) Downloaded 525 times

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Rev with parameter checking

#18 Post by vovchik »

Dear Sigmund,

Here is a slight revision that includes a very primitive parameter check. I noted that my earlier version ignored the "-s" parameter. The benefit of this mod, apart from properly passing the command line parameter, is that it provides a very rudimentary help - both on the command line and using Xdialog.

With kind regards,
vovchik
Attachments
pstopwatch-2.tar.gz
(1.32 KiB) Downloaded 512 times

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#19 Post by zigbert »

Thank you, vovchik.

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#20 Post by trapster »

Working great now with vovchick's script.
I was getting the repeating list of time like Lobster was.

I had to comment out line 38 in pstopwatch_counter due to "true" showing up in the tenths spot.

I also added a colon (":") before $TENTH in line 40:
echo -e "$MIN:$NULL$SECONDS:$TENTH" >> /tmp/pstopwatch-clock

Image
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

Post Reply