name mode size
Countdowns 040000
Countups 040000
Icons 040000
Launchers 040000
Time Since a Past Datetime 040000
LICENSE 100644 34.52kB
README.md 100644 9.39kB
Timer.phpg 100755 29.13kB
README.md
# Simple Countdown or Countup Timer Last modified Feb. 13, 2018. First released March 31, 2017. Requires PHP-GTK. Countdown or countup to a future datetime, or display how much time has passed since a past datetime. Pause and resume buttons appear if you specify hours, minutes, and/or seconds instead of a datetime. Can execute a user-specified shell command after the timer is done. ----------------------------------------------------------------------------- Code mostly by Apollia, but I (Apollia) also used and modified parts of this script, which is not by me: http://www.kksou.com/php-gtk2/sample-codes/set-up-a-countdown-timer-Part-2-a-more-accurate-timer.php <br> Thanks to the author of that script and wonderful website and ebooks! http://kksou.com/ is one of the best, most educational websites about PHP-GTK I've ever found. I highly recommend it! <br> Thanks to Double-J Design and Artbees, the artists of the two icons included with this software! http://www.doublejdesign.co.uk/ http://artbees.deviantart.com/ <br> The default icon - a clock - is from: http://www.iconarchive.com/show/handy-icons-by-double-j-design/clock-icon.html It is by Double-J Design: http://www.doublejdesign.co.uk/ License: CC Attribution 4.0 http://creativecommons.org/licenses/by/4.0/ <br> The tomato icon, used with the Pomodoro demo scripts, is from: http://www.iconarchive.com/show/paradise-fruits-icons-by-artbees/Tomato-icon.html It is by Artbees: http://artbees.deviantart.com/ License: CC Attribution-Noncommercial-No Derivate 4.0 http://creativecommons.org/licenses/by-nc-nd/4.0/ <br> Also, thanks to IconArchive.com for making it so easy to find nice icons! http://iconarchive.com/ ----------------------------------------------------------------------------- This software seems to mostly work well enough, but sorry about the glitches I (Apollia) created and don't yet know how to fix. Please don't run too many timers at once, because the worst glitch I encountered with this script so far was, my Lighthouse 64 Puppy Linux 6.02 Beta 2 computer got tremendously slowed down when I tried opening a lot of the included demo scripts at the same time. That made it nearly impossible to do anything, so, to escape that, I had to press Ctrl-Alt-Backspace to exit X Windows, then typed "xwin" at the prompt to get back into X Windows. <br> Fortunately, it seems I can run a reasonable number of timers at the same time. It starts to get noticeably slowed down after I open more than 20 timers on my 3.4 GHz desktop computer with 2 cores and 4 GB of RAM. <br> There also was sometimes a problem with pausing and resuming sometimes causing odd little jumps forward or backwards in time. And the times printed to the console sometimes were a second away from the time displayed in the GUI. And often the actual time the timer gets done is seconds away from the time it was supposed to get done. And there could be other glitches too. So, please don't depend on this script for perfect timekeeping. <br> It's too much trouble at the moment for me to try to figure out how to fix these glitches. But, at least it seems to mostly work, so, I'm mostly satisfied with it for now. ------------------------------------------------------------------------------ This software can show two different kinds of timers: * Countdown timers show time remaining until a particular time in the future. <br> * Countup timers can start at 00:00:00, or any other time you want, and either: - Count up until a particular time in the future. - Count up infinitely to show how much time has passed since a time in the past. ------------------------------------------------------------------------------ Keyboard Shortcuts Pause: P, S, Ctrl-P Resume: R, Ctrl-R Quit: Q, Ctrl-Q ------------------------------------------------------------------------------ Features: * Can execute any shell command you want after the countdown (or countup) is done. * Customizable window title, icon, and note near the top of the timer window. <br> * You can specify dates/times in a variety of formats, even with very plain English, like "tomorrow", or "midnight". Examples of acceptable input: http://php.net/manual/en/datetime.formats.relative.php http://php.net/manual/en/datetime.formats.time.php http://php.net/manual/en/datetime.formats.date.php <br> * Or, you can put in exactly how many hours, minutes, and/or seconds the timer should run for. <br> * Pause and Resume buttons are shown if you specified hours, minutes, and/or seconds instead of a future date/time. Keyboard shortcuts: - P, Ctrl-P, Ctrl-S: Pause - R, Ctrl-R: Resume <br> * To quit the program, you can type: Q or Ctrl-Q <br> * This software can be launched with command line arguments, listed below. * Numerous demo scripts which launch various timers (and which also show the usage of some of the below command line arguments) are included in these folders: "Countdowns", "Countups", "Time Since a Past Datetime" ------------------------------------------------------------------------------ All arguments are optional. If no arguments are provided, the timer will display a 5 minute countdown by default. Arg 1: "title" The title you want the timer window to have. Arg 2: "note" A note you want shown near the top of the timer window. Arg 3: "icon_fillepath" A fillepath (full, absolute filepath) to your desired icon for the timer window's title bar. Arg 4: "count_up_or_down" Possible settings: "up" or "down" <br> Arg 5: "dest_datetime" To make the timer count down (or up) all the seconds until a particular date/time, set this to any date/time text that PHP's strtotime() function can understand. This is impressively flexible - see the below links for examples. http://php.net/manual/en/datetime.formats.relative.php http://php.net/manual/en/datetime.formats.time.php http://php.net/manual/en/datetime.formats.date.php If you set Arg 5, don't set Args 8 thru 13, since they'll be ignored. <br> Arg 6: "dest_datetime_format" If you don't set this, dest_datetime will be displayed in the timer window in this format by default: "Fri, 31 Mar 2017 14:56:04 -0400" Arg 6 lets you choose your own format. See this link for more info: http://php.net/manual/en/function.date.php <br> Arg 7: "shell_command_to_exec_when_timer_done" A shell command you want executed after the timer is done with its countdown (or countup). <br> Args 8, 9, 10: "total_hours", "total_mins", "total_secs" The total amount of time you want the timer to run. Ignored if Arg 5 ("dest_datetime") is present. <br> Args 11, 12, 13: "start_hours", "start_mins", "start_secs" Set one or more of these if you want to make the timer skip ahead to a later time in the countdown (or countup). Ignored if Arg 5 ("dest_datetime") is present. <br> Arg 14: "should_show_start_and_end_times" Set to "y" or "yes" to make the timer definitely display the text "Timer started:" and "Timer ended:". Set to anything else to hide that text. If not set, the value of the constant "Default_for_should_show_start_and_end_times" is used instead. ----------------------------------------------------------------------------- Changelog Feb. 13, 2018: * Icon capabilities and 2 icons added. * A Quit button. <br> * Now there are keyboard shortcuts to quit, pause, and resume. Pause: P, S, Ctrl-P Resume: R, Ctrl-R Quit: Q, Ctrl-Q <br> * The Timer script accepts 2 new arguments: - Arg 1: title - Arg 3: icon_fillepath ...which unfortunately means that all old Timer launcher scripts will need to be updated. Fortunately, this might only affect me, because currently, I suspect I might be the only user of this program in the world, so far. :-) <br> * The new Arg 1, "title", lets you set the timer window's title. * The new Arg 3, "icon_fillepath", lets you use whatever custom icon file you want in the timer window's title bar, just by providing a full, absolute filepath (or, as I call it for short, a fillepath) to that icon file. The icon can be a PNG file, or perhaps other formats. <br> * The old Arg 1, "note", is now Arg 2. * Improved Mr. Standardized Input a bit. * Added a Launchers folder, containing a launcher file which can be symlinked to from an execpath location such as /usr/bin/, making it possible to launch timers using console commands like these: Simple-Countdown-or-Countup-Timer Simple-Countdown-or-Countup-Timer '24 hours' '24 hours' '' 'up' '' '' '' 24 0 0 ------------------------------------------------------------------------------ Under the GNU Affero General Public License v3.0. Copyright (C) 2017/2018 Apollia This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Contact info: http://astroblahhh.com/contact-apollia.shtml