LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Countdown timer for Linux? (https://www.linuxquestions.org/questions/linux-newbie-8/countdown-timer-for-linux-949463/)

kona0197 06-10-2012 12:40 AM

Countdown timer for Linux?
 
Is there any easy to install countdown timers for Linux? Google didn't yeild any great results.

lithos 06-10-2012 01:20 AM

Hi,

"countdown" to what ?

- shutdown ?
- PHP / javascript ?

what is the purpose of the countdown that you need.

You are asking a question not quite specific, like "my car is broken, what is wrong " type of question that nobody can help.


Please write what do you need to do and what have you done by now, so you can get appropriate answer.
Otherwise you will get
"Google didn't yeild any great results."

kona0197 06-10-2012 12:34 PM

Just a simple countdown timer so I can time when I need to pull things out of the oven, know when the dryer is done, ect.

sysfce2 06-10-2012 02:53 PM

I use KAlarm (part of KDE).

273 06-10-2012 03:13 PM

I used to use kteatime when I ran KDE. Not sue what's available for other DEs though.

teckk 06-10-2012 03:50 PM

You could use sleep

Sleep 5 min and then play a sound.
Code:

sleep 300 && mplayer audiofile.mp3
Sleep 1 min and then have espeak say wake up.
Code:

sleep 60 && espeak "wake up" 2>/dev/null
Or something simple like
Code:

sleep 5 && xterm -fg yellow -T "Wake Up" -g 40x10

fogpipe 06-10-2012 05:12 PM

A nice tcl/tk timer. You will have to edit it to replace the alarm sound with one you like.

Code:

#!/usr/bin/wish -f
        set intime [lindex $argv 0]
        set intimeI [expr $intime * 60]       

      proc countdown {seconds} {
          init
          countdown_kernel $seconds
      }
     
     
      proc countdown_kernel seconds {
          hands $seconds
          if !$seconds return
          after 1000[list countdown_kernel [incr seconds -1]]
      }
     
     
      proc draw_hand {angle decorations} {
          eval .c create line $::size $::size [get_xy $angle] $decorations
      }
     
     
      proc end_coordinate difference {
          set hand_length [expr $::size * .9]
          return [expr $::size + $hand_length * $difference]
      }
     
     
      proc get_xy angle {
          return[list [end_coordinate [expr sin($angle)]] \
                      [end_coordinate [expr -cos($angle)]]]
      }
     
     
      proc hands seconds {
          catch {.c delete withtag hands}
     
          set twopi 6.283185
          set seconds_angle [expr $seconds * $twopi / 60.]
          draw_hand $seconds_angle "-width 1 -tags hands"
          set minutes_angle [expr $seconds_angle / 60.]
          draw_hand $minutes_angle \
                      "-width 3 -capstyle projecting -tags hands"
      }
     
      proc init {} {
          catch {destroy .c}
          set ::size 90
          set full_diameter [expr 2 * $::size]
          pack [canvas .c -width $full_diameter -height $full_diameter]
          set border 2
          set diameter [expr 2 * $::size - $border]
          .c create oval $border $border \
                        $diameter $diameter \
                        -fill darkred -outline gold 
      }

          proc helw {} {
                          wm title . "TIME IS UP!"
                          button .bHello -text "                        Times Up!                        " -command exit
                          pack .bHello
                          exec play /usr/share/sounds/tinsha.wav &
          }
     
     
      countdown $intimeI
        after [expr $intimeI * 1000]  helw 

       

#          puts stdout "Time is $intimeI"

It needs an arguement to start. So if you save it as "timer", make it executable and start it for example with "timer 10" if you want to time 10 minutes. I have it bound to keys in fluxbox to time different kinds of tea.

The one on this page looks interesting and fairly easy to customize:
http://handybashscripts.blogspot.com...gress-bar.html

kona0197 06-10-2012 06:01 PM

Sorry, I don't know how to code in Linux. I was just looking for an program that would install easy on Fedora running the LXDE desktop.

schneidz 06-10-2012 06:12 PM

i did a search using yum:
Code:

[schneidz@hyper ~]$ yum search timer
Loaded plugins: refresh-packagekit
================ N/S Matched: timer =================
gnome-applet-timer.x86_64 : A countdown timer applet
                          : for the GNOME panel
perl-Template-Timer.noarch : Template::Timer Perl
                          : module
xfce4-timer-plugin.x86_64 : Timer for the Xfce panel
dieharder.i686 : Random number generator tester and
              : timer
dieharder.x86_64 : Random number generator tester and
                : timer
erlang-cosTime.x86_64 : Orber OMG Timer and
                      : TimerEvent Service
php-phpunit-PHP-Timer.noarch : PHP Utility class for
                            : timing
ppl-pwl.i686 : The Parma Watchdog Library: a C++
            : library for watchdog timers
ppl-pwl.x86_64 : The Parma Watchdog Library: a C++
              : library for watchdog timers
 
  Name and summary matches only, use "search all" for
 everything.


kona0197 06-10-2012 06:26 PM

Well I'm not using GNOME or XFCE.

schneidz 06-11-2012 06:28 AM

i came up with this:
Code:

i=10; while [ $i -gt 0 ]; do echo $i seconds remaining; i=`expr $i - 1`; sleep 1;  done
if you need it to be gui, i'll see if i can wrap it around zenity.

this worx:
http://handybashscripts.blogspot.com...gress-bar.html

frankbell 06-11-2012 08:41 PM

Googling "stopwatch fedora" or "stopwatch linux" turned up not much of anything (I googled for stopwatch figuring I might have more luck by finding a stopwatch with a countdown function than I would googling for "counter").

I found this. It counts up, not down, but it might be worth a look.

http://davy.nyacom.net/logtimer.html

lithos 06-12-2012 02:09 AM

What about Alarm-clock ?
By the way you describe what tasks you want I would use it.

not_bob 05-27-2013 08:31 AM

Quote:

Originally Posted by teckk (Post 4700152)
Code:

sleep 300 && mplayer audiofile.mp3

I knew there was something brain dead simple I could do with the command line. Thnx, teckk.

eklavya 05-27-2013 08:59 AM

If you want GUI, install KTIMER.


All times are GMT -5. The time now is 08:06 PM.