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 Mon 24 Nov 2014, 01:30
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
"tm" command line timer
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [19 Posts]   Goto page: Previous 1, 2
Author Message
don570


Joined: 10 Mar 2010
Posts: 3379
Location: Ontario

PostPosted: Thu 17 Feb 2011, 19:53    Post subject: GUI Project for tm  

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:

<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:
/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.
________________________________
Back to top
View user's profile Send private message 
zigbert


Joined: 29 Mar 2006
Posts: 5786
Location: Valåmoen, Norway

PostPosted: Thu 03 Mar 2011, 13:15    Post subject:  

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

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3379
Location: Ontario

PostPosted: Thu 10 Mar 2011, 19:00    Post subject: script loops a given number of sconds  

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:

#!/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, 19:10; edited 1 time in total
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3379
Location: Ontario

PostPosted: Thu 10 Mar 2011, 19:09    Post subject: change line  

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

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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [19 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0637s ][ Queries: 12 (0.0137s) ][ GZIP on ]