"tm" command line timer

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

GUI Project for tm

#16 Post by don570 »

I decided to add a message field to the GUI
and to localize it using Zigbert's method.

ptmtimer-1.3.pet

and here's the locals(French,German,Spanish)
ptmtimer-NLS-1.3.pet


Here's how I added a message field...

Code: Select all

<frame '$LOC200'>
<hbox>  
  <entry>
    <default>'$LOC201' </default>
    <variable>MESSAGE</variable>
  </entry>
</hbox>
</frame>
There is now three variable values that I pass to 'tm'

Code: Select all

/usr/local/ptmtimer/tm ${ENTRY} ${SND}  ${MESSAGE}
Following Zigbert's method , I create a folder /usr/local/ptmtimer/
to hold the program but the app has to be launched from an executable
path so I create a small script just to launch the app.
________________________________

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

#17 Post by zigbert »

Pmusic 1.6.4 has got a -B switch witch makes it possible to use Pmusic as a dead simple (fast and low cpu usage) command-line player.


Sigmund

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

script loops a given number of sconds

#18 Post by don570 »

I made a change to tm script to make it loop indefinitely
with a given period (in seconds). It might be useful to
someone who has an operation that must be done continually,
like checking a file. I'm not a programmer so
I don't know how this script works. I was just tinkering.

Code: Select all

#!/bin/sh 
#This script loops endlessly  with a period of tsec
until [ -z 4 ]
do
tsec=9
n="0"
for ((i=0;i<=${tsec};i++)); do
n="$((${n} + 1))"
if [ "$n" == "${tsec}" ]; then

gxmessage  "Hello  Message"


fi
sleep 1
done
done
exit
____________________________________________
Last edited by don570 on Thu 10 Mar 2011, 23:10, edited 1 time in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

change line

#19 Post by don570 »

If you change the line 'gxmessage "Hello Message"' to

Code: Select all

yaf-splash   -bg orange  -fontsize x-large    -text  "  minutes is up.
 Timer has finished!!!           "  -close box & 
there is slightly different behaviour as the message keeps popping up
and becomes very annoying.

Post Reply