You are not logged in.
Info page: http://xyne.archlinux.ca/projects/pystopwatch
I wrote a gui timer in pyGTK because I couldn't find a nice one (I don't remember exactly how it behaved, but this should be a bit similar to the xfce4-timer-plugin, but without needing a specific panel). Use it to avoid overcooked pizzas or angry girlfriends woken up by loud, annoying (yet thus effective) oven timers.
Check the info page for screenshots, alarm command suggestions and where to find the preferences. Usage should be obvious.
Please let me know if there's anything wrong with the dependencies.
Suggestions, comments and feature requests are welcome.
Last edited by Xyne (2018-11-24 21:54:08)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I'm loving it!!! Just found it. So, I may be a bit dyslexic as so off to read the prefs stuff as I really need to find out if there's an alarm! :--)
OK, so minimizing it....hmmm... I use a wm musca... Any tips are great though I'll figure it out at some point.
Last edited by yvonney (2009-06-21 04:46:46)
Offline
I'm loving it!!! Just found it. So, I may be a bit dyslexic as so off to read the prefs stuff as I really need to find out if there's an alarm! :--)
OK, so minimizing it....hmmm... I use a wm musca... Any tips are great though I'll figure it out at some point.
If Musca is anything like Xmonad then you don't have anywhere for it to minimize to. If that is the case you can use trayer:
pacman -S trayer
I use it with Xmonad, pretty simple setup.
#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.
Offline
I'm loving it!!! Just found it. So, I may be a bit dyslexic as so off to read the prefs stuff as I really need to find out if there's an alarm! :--)
OK, so minimizing it....hmmm... I use a wm musca... Any tips are great though I'll figure it out at some point.
Thanks. Let me know if you have any trouble setting up an alarm command and I'll try to help.
I've never used Musca but the wiki page contains entries in the .musca_start file for stalonetray so that should work too. That's what I use here with Openbox.
That also reminds me that I need to create an icon for pystopwatch.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I use stalonetray which seems to be the most generic for musca etc. though not entirely sure.
So, I have a .musca_start. thanks for thinking.
I'll have to give this a think once the crazy busy slows a bit. cool!
Offline
Ok, I've finally added an icon. I'm not sure if I'll keep it though but it's better than the stock play icon (I hope).
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I really like this app, but I cant seem to get the settings to stick. I set this alarm command
/usr/bin/aplay -q /home/tj/sound-effects/stopwatch.wav &
Whenever I close the program everything reverts back to defaults, which is blank.
EDIT:
I just checked ~/.config/pyStopwatch.conf and the alarm command is correct there, but when I open pystopwatch it doesnt seem to be reading the conf file because its still not working.
Last edited by tjwoosta (2009-09-19 21:24:29)
Offline
@tjwoosta
It should work with the latest version. Apparently pyStopwatch has never loaded the alarm command setting (I somehow skipped it when I wrote the configuration file parser). I can't believe that it was only discovered now. I guess there really are only about 3 people using it, and rarely at that.
Anyway, while I was tinkering around with the code, I've done the following:
* now uses the XDG_CONFIG_HOME environment variable when set
* "%t" in the alarm text will be replaced with the current pystopwatch time
* if the alarm text begins with "#!", the rest of it will be executed as a command and the output will be used as the alarm text
* added a "help" entry to the tray icon's right-click menu which displays the man page
* it now invokes python2 instead of python to ensure future compatibility
* updated the man page
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Nice work! I'd love to use this as a workout timer....any chance of getting an intervals function built-in somehow. Set x intervals of y minutes work and y seconds(minutes) rest, with a chime or sound in between each one. I found one python command line timer here and one html/javascript timer you can use locally here. Yours already looks nicer
Thanks!
Scott
Offline
After giving the idea of intervals some consideration, I don't see a direct way to add it to the existing code. The logic itself wouldn't be that difficult but the user interface is problematic. I thought of maybe adding a dropdown configuration panel for setting intervals but I think it would jar with the current simple interface.. I also thought of adding command line arguments so that it could be used from a script but that seems clunky.
I'll reconsider it though if I come up with a nice way to do it.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thanks for the update, its working great now
Offline
hej..can you pleas explain me where the config file should be and if there is a way to configer the timer out side the GUI..
exmp: "pystopwatch countdown-a 1m" and then to play something..i didnt get the thing with the options..
i use awesome and i dont have anything on right-clink..
thnx.
Offline
There is no command-line functionality because it would be trivial to write a script to do just about anything that pystopwatch does (e.g. "sleep 300 && mpg123 time.wav"). You're not the first one to ask about that though so I might eventually clean up the code to make the GUI a proper configurable widget for use in other applications, but that is no where near the top of my ToDo list.
The configuration file resides in $XDG_CONFIG_HOME/pystopwatch, which is ~/.config/pystopwatch by default.
I've just updated pystopwatch so that you can access the tray's context menu directly via the GUI by right-clicking on the display frame. Previously it assumed that you had a tray installed (e.g. stalonetray).
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Sorry for necrobumping, but I just found this nifty bit of software and I adore it. Thanks, Xyne
Offline
I think the Timer mode needs to renamed to Stopwatch and the two countdown modes renamed to Timer.
Whereas a stopwatch counts upwards from zero for measuring elapsed time, a timer counts down from a specified time interval, like an hourglas
BTW in the font selection dialog, the cancel and ok button do not close the window.
Last edited by anonymous_user (2010-07-06 19:37:00)
Offline
@Hide
Thanks
Btw, bumping a project thread is not considered necrobumping.
@anonymous_user
I've changed "timer" to "stopwatch" and "countdown" to "countdown timer" to make it clear. I've also fixed the font selection dialogue and corrected two other noobish pyGTK mistakes.
Last edited by Xyne (2010-07-06 22:51:02)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thanks Xyne. And one more thing: when the pyStopwatch windows comes up (after the timer completes) would it be possible to flash in the taskbar (aka urgency)?
Offline
Another request, could an option be added to make pyStopwatch display the current time in 12hr instead of 24hr?
Offline
I considered it and even started implementing it, but adding a 12h mode presents loads of little niggling issues with formatting, and widget alignments, My time at the moment is limited and I'm reluctant to spend it on something that seems so trivial.
Plus there's the ever-present temptation to clean up the code and I'm too easily sidetracked. (You can tell that it's one of the first things I wrote in Python. )
I will probably add it eventually but I don't know when. Sorry.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Hi,
I recently upgraded to pystopwatch from the defunct CLI tool 'utimer'. I'm pretty happy with pystopwatch so far, and I specifically appreciate the ability to manually alter the H/M/S of the current time (since I occasionally forget to start the stopwatch!).
However, I hate clicking on things, especially small buttons. It would be really nice if the Start/Stop button activated when Enter or Space is pressed; then the user would only need to focus the window ( a much larger target than the button, obviously) and press Enter once to stop/start the timer. A side effect would be that the timer could be started/stopped within a script, using xdotool.
IIRC, passing 'default=True' parameter when constructing the start/stop button, causes it to activate when Enter is pressed.
If you considered also giving a keyboard shortcut to Reset and Mode -- eg. Alt+R, Alt+M, that's IIRC even easier : just insert a mnemonic marker in the label text when constructing the button, eg "Reset" -> "_Reset", and the mnemonic handling takes care of the rest.
One bug report: after the first time bringing up the font selection dialog (successfully), selecting a font, and closing the window, and hitting 'apply and save', successive openings instead produce a small window -- let's say 16x16 px in size -- with nothing in it; the only thing I can do with that window is close it.
EDIT: The above bug is only a minor annoyance, since I can restart pystopwatch in order to access the font selection dialog if needed.
Last edited by likytau (2018-10-10 04:36:54)
Offline
An 8 year bump, almost to the day? I find it highly unlikely that Xyne is working on or maintaining this project. Thanks for a proper post though! Hopefully someone will be able to help you.
I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.
Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...
Offline
I find it highly unlikely that Xyne is working on or maintaining this project.
Oh? It's still on Xyne's website. The AUR package still has Xyne as a maintainer, and it was updated earlier this year.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Regarding the main issue, in a typical setup,
self.run_button.set_can_default(true)
self.run_button.grab_default()
seems like the correct method to make a widget activate by default. But at least in this setup, it has no effect on which button activates on Enter keypress. The activated widget is always the currently focused widget.
Regarding the secondary issue, adding mnemonics / alt-R|M keyboard shortcuts was as simple as I said; here is a very short diff, probably should be applied using 'patch -p1':
--- a/pystopwatch 2018-10-10 15:09:20.855571955 +1030
+++ b/pystopwatch 2018-10-10 15:47:27.771484050 +1030
@@ -356,7 +356,7 @@
self.sec.show()
# reset button (alone, for the sake of the layout)
- self.reset_button = gtk.Button(label='Reset')
+ self.reset_button = gtk.Button(label='_Reset')
self.reset_button.connect("clicked",self.reset)
self.reset_button.show()
@@ -364,7 +364,7 @@
self.control_box = gtk.HBox()
self.control_box.show()
- self.mode_button = gtk.Button(label='Mode')
+ self.mode_button = gtk.Button(label='_Mode')
self.control_box.add(self.mode_button)
self.mode_button.connect("clicked",self.toggle_mode)
self.mode_button.show()
Offline
@likytau
Thanks for the idea and patch. I ended up doing it a little different with the following hotkeys:
r and <alt>+r reset,
tab and <alt>+o change the mode
space toggles start/stop
h and H increment and decrement the hour
m and M -"- minute
s and S -"- second
I spent about 10 minutes unsuccessfully trying to find a way to detect if the alt key was pressed on an "m" key event. I then gave up on using <alt>+m for the mode. If someone finds a solution then I'll update the code.
The update should be up shortly.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Nice, thanks for taking the time to implement my idea. I've tested all those actions and they mostly work well -- space and tab are a bit spotty though, see below.
I spent about 10 minutes unsuccessfully trying to find a way to detect if the alt key was pressed on an "m" key event. I then gave up on using <alt>+m
(EDITED)
I see, so your key-handler is swallowing the M unconditionally, when it really should only do anything when no modifiers are pressed. I'll see what I can find out about that.
Space and Tab currently have a double action. That is, Tab moves keyboard focus between widgets AND cycles mode; Space activates the current widget AND pauses/unpauses (this is particularly funny when the Stop/Start button is focused. I'd guess the action is triggered twice and thus cancels itself out). My guess would be that your signal handler needs to run before the default GTK signalhandler for these events, and prevent subsequent handlers from running (I think this latter thing is done by returning True from the signal handler)
EDIT: BTW, link to project in OP appears to be broken. Corrected link: https://xyne.archlinux.ca/projects/pystopwatch/
EDIT2: OK, double-action fix is really easy; just make handle_key() return True in the branch which invokes handler(). With that, this is really comfortable now IMO.
EDIT3: Alt+m for Mode button works after adding a
if event.state != 0:
return False
check at the start of handle_key. State seems to represent modifier state (so, 0 if no modifiers are pressed)
Last edited by likytau (2018-11-20 06:57:24)
Offline