Subentry of
Projects
Sun19Aug2007
This program, all it does is take a command and a time, and then show a progress bar in the middle of your screen counting down to when the command is going to happen.
plzwait --time 1 --command "xset dpms force off" --message "Monitor Off..."
One feature is that while it is counting down the event can be canceled. What time does your CRON usually run `updatedb`? Probably at like 4am, right? Well so does mine but sometimes I am actually sitting here still at 4am and you think I want UpdateDB sucking up my CPU? With this little middle man if I am sitting here and I need my PC, that event could be canceled.
plzwait --time 10 --command "updatedb" --message "Scheduled UpdateDB..."
Because this is GTK it is doing a lot of stuff besides counting, so do NOT use this for time critical applications. Why? It is not an exact timeout because it wastes time doing other things. For example:
//. bob@elenothar [/]$ timer plzwait --command "echo" --time 60
60.718015 sec
It actually spent 60.718015 seconds when it was told to spend 60. If your life was depending on nothing past 60 seconds you would be screwed. Thankfully the BSD license covers me incase you do end up killing yourself because of a late timeout. Most of that is system and GTK init anyway, well that and time spent telling GTK to update the screen.
You ask then, what was the point in writing this? I have a keyboard shortcut set to put my monitor into sleep mode, however it usually wakes itself up when the key release events are detected. With this I delay the sleep mode by 1 second and by then I am probably not even in the room still. I obviously do not care if the monitor shuts off in 1 second or 1.07 seconds. The progress bar is confirmation that the right keys were hit when fumbling in the dark and I walk away.
Hitting escape while the progress bar is running will cancel the timeout. Control+C will also cancel the timeout.
Downloads
Source: plzwait-1.0.tar.bz2
Binary (Linux i686, glibc 2.5): plzwait-1.0-bin.tar.bz2
SVN Access
svn checkout http://bobmajdakjr.googlecode.com/svn/trunk/plzwait plzwait