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 29 Jul 2014, 07:04
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
Looking for a countdown timer with alarm
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [18 Posts]   Goto page: 1, 2 Next
Author Message
T_B

Joined: 08 Apr 2007
Posts: 154

PostPosted: Sat 24 Nov 2007, 04:12    Post subject:  Looking for a countdown timer with alarm  

Looking for a small utility to enter a countdown timer (egg timer/cooking timer)
Searched the board, but didn't find something like this. Maybe I' m searching the wrong way, don't think I'm the first one in need for such a program.
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Sat 24 Nov 2007, 05:02    Post subject:  

Puppy has one. It might not be in the latest Puppy, but it is an official PET package. It's called 'countdown'.
Back to top
View user's profile Send private message Visit poster's website 
T_B

Joined: 08 Apr 2007
Posts: 154

PostPosted: Sat 24 Nov 2007, 05:27    Post subject:  

Thanks Barry, this was indeed something I was looking for (it is called countdown.tcl in puppy 3.01). The only major problem is it seems to be a silent alarm or is there another version?
Back to top
View user's profile Send private message 
mcewanw

Joined: 16 Aug 2007
Posts: 2251
Location: New Zealand

PostPosted: Sat 24 Nov 2007, 05:40    Post subject:  

In Puppy version 2.17 there is a countdown timer in JWM Menu -> Personal

However I don't think the alarm is audible, but certainly visual (can't test that at the moment though, sorry).

Should be pretty easy to write a simple bash based script (using, say, the sleep command) to trigger playing an audio file though. I'm sure someone will sort you out with that (I'd throw something together, but I'm in the middle of another programming project so can't just now).

Just to give you the idea though, if you open an rxvt command console and enter the following you'll see the possibility (later you would say substitute echo with a command to start up a sound playing program):

sleep 3; echo hello

The above is for a 3 second delay...
Back to top
View user's profile Send private message Visit poster's website 
mcewanw

Joined: 16 Aug 2007
Posts: 2251
Location: New Zealand

PostPosted: Sat 24 Nov 2007, 05:52    Post subject:  

oops, Barry beat me to it before I had time to recheck the posts... Smile
Back to top
View user's profile Send private message Visit poster's website 
T_B

Joined: 08 Apr 2007
Posts: 154

PostPosted: Sat 24 Nov 2007, 06:08    Post subject:  

Thanks mcewanw

For my purposes " sleep [time]; gxine alarm.mp3 " is good enough.
Would be nice to have something with a gui though Smile
Back to top
View user's profile Send private message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Sat 24 Nov 2007, 06:20    Post subject:  

T_B wrote:
For my purposes " sleep [time]; gxine alarm.mp3 " is good enough.
I think that sleep can drift, so . Try using pschedule to create a cron event and start the cron daemon.
_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send private message 
muggins

Joined: 20 Jan 2006
Posts: 6673
Location: lisbon

PostPosted: Sat 24 Nov 2007, 06:33    Post subject:  

I had a squizz at countdown.tcl & it has a section of code commented out:

Code:

if { ![catch { package require snack }] } {
    snack::sound alarmsound -file \
   [file join [file dirname [info script]] attention.wav]

    set ::countdown::gui::alarmcmd [list alarmsound play -block 1]
} else {


when I uncommented the code, it complained that it couldn't find /usr/local/bin/attention.wav. But when I replaced this with alarm.wav, and placed the file alarm.wav in /usr/local/bin bingo!
Back to top
View user's profile Send private message 
muggins

Joined: 20 Jan 2006
Posts: 6673
Location: lisbon

PostPosted: Sat 24 Nov 2007, 07:01    Post subject:  

T_B,

The attached .zip contains a modified countdown.tcl & alarm.wav. I f you copy them to /usr/local/bin, then countdown has an audible alarm.

Does anyone know what modifications are required to the script, so that alarm.wav is located in /usr/share/audio, rather than /usr/local/bin?

Edit: Woops! No wonder it didn't work for T_B. I uploaded the wrong file. Have uploaded the one that does work, if alarm.wav is in the same directory.
countdown.zip
Description 
zip

 Download 
Filename  countdown.zip 
Filesize  7.5 KB 
Downloaded  169 Time(s) 

Last edited by muggins on Sun 25 Nov 2007, 08:21; edited 1 time in total
Back to top
View user's profile Send private message 
T_B

Joined: 08 Apr 2007
Posts: 154

PostPosted: Sat 24 Nov 2007, 07:03    Post subject:  

Doesn't work for me, I think it got something to do with snack. I've read a comment from Barry that is was broken in newer puppy's.
Back to top
View user's profile Send private message 
Ian
Official Dog Handler


Joined: 04 May 2005
Posts: 1237
Location: Queensland

PostPosted: Sat 24 Nov 2007, 08:14    Post subject:  

Here is a quick & dirty timer that I just threw together.

Has no sound as I haven't had time to work out how to beep yet.

Just download and unpack it to a directory and open a terminal in that directory then type:

./timer.tcl
PTimer.tar.gz
Description 
gz

 Download 
Filename  PTimer.tar.gz 
Filesize  502 Bytes 
Downloaded  185 Time(s) 

Last edited by Ian on Sat 24 Nov 2007, 11:42; edited 4 times in total
Back to top
View user's profile Send private message 
mcewanw

Joined: 16 Aug 2007
Posts: 2251
Location: New Zealand

PostPosted: Sat 24 Nov 2007, 08:25    Post subject:  

Ian

If you just modify the wee part of your program to use muggins' /usr/local/bin/alarm.wav file like follows, your alarm gives sound...

Code:
while {$t<$tm} {
           
incr t
exec sleep 1
}
         
exec play /usr/local/bin/alarm.wav


of course, you can now put alarm.wav in some other folder instead.

Might be best to put a gtkdialog3 version together though, since I think the newest Puppy (Dingo) doesn't have a tcl interpreter (but I haven't had time to download and try it so could be wrong)
Back to top
View user's profile Send private message Visit poster's website 
Ian
Official Dog Handler


Joined: 04 May 2005
Posts: 1237
Location: Queensland

PostPosted: Sat 24 Nov 2007, 08:43    Post subject:  

Thanks for that.
Here are a couple of things to add:

catch {exec play /usr/local/bin/alarm.wav}

this to catch the errors and:

after line 19 add:

focus .top.tmr

this to save a mouse click Smile

I'll upgrade it on the post.

If I get time I might try and tidy it up a bit.
Back to top
View user's profile Send private message 
T_B

Joined: 08 Apr 2007
Posts: 154

PostPosted: Sat 24 Nov 2007, 08:46    Post subject:  

The version of Ian works very good with the adjustment of mcewanw. I think I will be able to adjust the tcl script myself to be perfect for my needs.

Thanks!
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Sat 24 Nov 2007, 09:30    Post subject:  

That's right, no Tcl/Tk in Dingo. It would be easy enough to implement in Bash, with a GINS or Xdialog or Gtkdialog GUI.
I have been deliberating whether to put in PuppyBasic or GtkBasic -- probably the latter, and that would also give you a GUI.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 2 [18 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
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.0770s ][ Queries: 12 (0.0104s) ][ GZIP on ]