Quote:
Originally Posted by inameiname
This is pretty cool. Thanks for sharing, and for all who contributed!
I wonder if it would be possible to have it automatically disable the screensaver when it is running. Basically so you don't have to input the ~disable screensaver bit each time. Or maybe there is a way to have it run instead of the screensaver.
As of now, you can probably easily create a Launchpad shortcut that would merely delay the screensaver from running instead of disabling it. I would just write a script that would first change the screensaver timeout (maybe change it to 24 hours or something), using a variant of this script: https://www.mobileread.com/forums/sho...d.php?t=162300, then have it run this clock program, and then when closed, it restores the screensaver timeout to what it was before. However, this is a bit of a workaround, and I am sure there is a much better way to do it.
Also, just to share, since the eInk lets you see the ghosting of where the second hand was in past seconds, I found it interesting that each of the fainted lines aren't uniformly spaced, or exactly the same amount of distance away from one another. Perhaps this reflects what geekmaster was talking about in regards to the delay the time the sleep(1) versus usleep(1000000) does. As such, it might not keep an accurate time as it stands now. But I would have to keep it on this clock for a while to test the accuracy of it.
Finally, would it be possible to be able to put both the kTimepiece program and the *.png files into a separate folder, rather than cluttering up the main directory, such as '/mnt/us/kTimepiece/' or something? I can already place the program into that folder and change the Launchpad shortcut, but the *.png of the clock itself has to be in the main directory.
Regardless, glad to finally get a nice little clock! Thanks.
|
The getmsec() function calls a system function that actually returns the date and time, but that may not be accurate if your kindle has not been connected to Internet or 3G recently. I just use it to monitor the accurate passage of time, so you could use it that way too. The first time it is called at program startup, it returns value 0; Any call after that is number of milliseconds since program startup, so if you know what time it was when you started, that tells you how many msec since then -- just divide the returned value by 1000 and add to your startup time (seconds). Do not try to keep accurate time with sleep() or usleep() calls. I implemented getmsec() for accurate framerate control, but you can use it to run a clock to. Just do it!
Some of my scripts in the "eink algorithmic art" thread pause the framework and disable screensavers, then resume them at the end. These "Dithermation" programs could use a system() call to do exactly the same thing, but in this case keep the framework running and only stop the screensaver, then restart it at exit.
These programs can run while IN screensaver mode, and in some cases actually run faster that way (not competing with the framework for resources). And if they sleep correctly with very little eink updating (like a clock) they do not eat extra battery. Sleep mode only shows a screensaver image and disables the keyboard -- the kindle basically "sleeps" all the time and the framework only wakes to process events like key presses. That is why the battery can last so long.