You are not logged in.
Hey guys,
Another "quick" project of mine: a stopwatch I found gnome-clocks a tad much for my simple stopwatch needs, so I wrote my own. I found a very basic one by Mutantturkey and forked it.
I ported it to GTK3, added a tree widget, some buttons, support for laps and more. What does it do? What you expect from a basic stopwatch! It starts running, pauses running, resets, stops and has support for laps. I looked into adding the split time between laps, but couldn't get this to work so I dropped it (personally, I don't need it anyway). Patches are welcome, though!
And the code: https://github.com/Unia/gtimeutils
AUR: https://aur.archlinux.org/packages/gtimeutils-git/
Last edited by Unia (2013-04-16 22:06:37)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
I have just added a small timer too. It's only an initial version for now, it still needs some improvements (see below) but the main function, counting down, works
Improvements:1. sound/notification when timer is done;
2. Colored buttons;
3. Sensitive buttons;
Last edited by Unia (2013-04-17 00:29:43)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
I just pushed a new update to Gtimer: you can now set the text to be displayed in the notification. If you don't specify it, it will say what it has always said before: Time is up!.
If you want to change that, just feed the GtkEntry something new and start the timer
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Any plans to add curses support?
All the best,
-HG
Offline
If I'd go that way, I guess I would have to approach this differently; I'm using Glib's timer functions. When using GTK, this isn't that much of a hurdle since GTK requires Glib.
Curses, however...
Last edited by Unia (2013-05-06 19:10:59)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Fair enough. Each day, I move one step closer to using only curses interfaces, with only a very few exceptions.
All the best,
-HG
Offline
I am willing to attempt coding a curses based stopwatch/timer, if you need one. It will probably take a while though, as I've never done curses before and I'm on a trip through Europe with my twin brother.
EDIT: Are you sure there's not already some available? I can't imagine no one has ever made one; I mean, for a skilled programmer this should be relatively easy.
Last edited by Unia (2013-05-06 19:24:21)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
I am willing to attempt coding a curses based stopwatch/timer, if you need one. It will probably take a while though, as I've never done curses before and I'm on a trip through Europe with my twin brother.
Really? Where abouts are you? And, I don't have a need for a curses-based timer at the moment, though it would be helpful when I go back to judging debate next Fall (certainly do not feel compelled to make one on my account).
All the best,
-HG
Offline
Currently we're in Crete, our previous and first destination was Istanbul. We have no idea what the next will be, but we're thinking of Budapest and we also want to see Chernobyl
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Any plans to add curses support?
All the best,
-HG
I suggest utimer. It is no curses interface, only console. You have a timer, a countdown, and a stopwatch. Everything with laps (enter), pause (space), stop (q).
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
I suggest utimer. It is no curses interface, only console. You have a timer, a countdown, and a stopwatch. Everything with laps (enter), pause (space), stop (q).
Iiiinteresting. I'll take a look at it. Don't want to thread-jack though.
All the best,
-HG
Offline
Would be awesome if you allowed to set timeout and text from command line, and then start immediately when run.
Offline
Would be awesome if you allowed to set timeout and text from command line, and then start immediately when run.
Interesting, I will look into this. Shouldn't be too hard I think.
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
chneukirchen wrote:Would be awesome if you allowed to set timeout and text from command line, and then start immediately when run.
Interesting, I will look into this. Shouldn't be too hard I think.
It wasn't and has been added Please test and see if this is what you wanted. I chose to use -u for hours since -h was already taken by default (by the help message) so I took the first letter of the Dutch word for hours: uren. If you want something else that might make more sense, tell me.
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Unia wrote:chneukirchen wrote:Would be awesome if you allowed to set timeout and text from command line, and then start immediately when run.
Interesting, I will look into this. Shouldn't be too hard I think.
It wasn't and has been added
Please test and see if this is what you wanted. I chose to use -u for hours since -h was already taken by default (by the help message) so I took the first letter of the Dutch word for hours: uren. If you want something else that might make more sense, tell me.
That's fine. Now I just want to have a flag to immediately start it (my use case is alias pizza="gtimer -m 8 -t "Pizza is ready!")
Offline
That's fine. Now I just want to have a flag to immediately start it (my use case is alias pizza="gtimer -m 8 -t "Pizza is ready!")
Done See the new -r option.
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
I know there are some people out there who stick with GTK2 as much as I try to go GTK3 only. For those people (and for the fun of it), I have updated GTimeUtils with GTK2 support. It required only a few changes.
You can choose which version to build by specifying -GTK{2,3} to make at compile time. See the README in the GitHub repository for more information.
EDIT: Also, Gtimer has gotten rudimentary systray support for those who have a systray. This code isn't finished, though, and definitely needs testing. If you use Gtimer and you have a system tray, could you give the latest version a go and report any issues to me?
Last edited by Unia (2013-05-19 22:53:06)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
I have removed the system tray. It might be back in a future version, but I don't want to have half-working features in my application. I will first perfectionalize the rest and then I might look into this again.
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline