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 Sun 21 Sep 2014, 18:31
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 Posts_count   Goto page: Previous 1, 2
Author Message
don570


Joined: 10 Mar 2010
Posts: 3289
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: 5728
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_website 
don570


Joined: 10 Mar 2010
Posts: 3289
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


____________________________________________

Edited_time_total
Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3289
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:   Sort by:   
Page 2 of 2 Posts_count   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:  

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.0650s ][ Queries: 13 (0.0153s) ][ GZIP on ]