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 Thu 18 Dec 2014, 05:40
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 Posts_count   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: 7099
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_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: 2350
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_website 
mcewanw

Joined: 16 Aug 2007
Posts: 2350
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_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: 6690
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: 6690
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  180 Time(s) 

Edited_time_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  193 Time(s) 

Edited_times_total
Back to top
View user's profile Send_private_message 
mcewanw

Joined: 16 Aug 2007
Posts: 2350
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_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: 7099
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_website 
Display_posts:   Sort by:   
Page 1 of 2 Posts_count   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:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0811s ][ Queries: 12 (0.0107s) ][ GZIP on ]