Kommander crontab 0.1
Kommander crontab was created to make some capabilities available to you in your applications, though it will work stand alone.
Purpose and Origins
After pondering using DCOP and Korganizer I decided this was probably a more suitable solution for my needs, probably no more complicated to set up and certainly better integrated. This is not the fully configurable interface of KCron, but it's not meant to be, It's meant to be used by non geeks.
Cron is a daemon for running scheduled programs, from every minute down to once a year and any combination you can think of. Look at man:/cron in Konqueror to learn more. I'm using it in unintended ways so I have some work arounds, like crafty techniques to enable automatic deletion of expired events. I also have done some tricks to make it even work in X. That's the great thing about *nix. Hit it with a hammer until it does what you want.
We're storing some information in text files to make life easier. That way we can update the functionality of the dialog without having to mess with the dialog its self. When it opens it will look to see if it has been previously initialized with key environment variables. It will then do some intelligent tricks to make this easy for users. If you had cron jobs in your crontab they will show up in this dialog. Be aware, by default everything a user has is in one file. Add some jobs and don't forget to save. Saving creates a copy of the crontab file, then calls "crontab crontab" which will srite the file if you did everything right... and you are a member of cron.
Environment variables in cron serve data like shortcuts to writing out the path. Since I use environment variables in file addresses things won't run without them. If this is all new google is your friend.
The alert.kmdr dialog is sort of special. It does tricks when you pass it parameters. For one thing you can have it time out and close its self. As spiffy as that is there are two more even cooler. It can delete its self after it pops up. This is because each entry in crontab is preceeded with a comment. My comment trick is to add the seconds since 1970-01-01 00:00:00 UTC, one of the cool tricks of date. I use this for a unique key and if you set it to delete it will delete both lines. You never have to do anything to make this happen. After all, nothign could be more disconcerting than an urgent alert 365 days old. At my age that's too much stress.
The final thing the alert can do is snooze. Hit the "Postpone" button and it pops up a section to enter the cron info in again. It's less granular, but is quite useful for basic one shot uses.
crondataprograms contains more than just alert.kmdr. I left them there for you to look at what was being done and the help. If you look at the environment variables and the included help info it should become clear.
Popping up user help
You'll see a button labeled "Program" and another labeled "Args". They are flat to imply a difference. In these buttons you can easily see where to add help text. You also might find it interesting how this is done with geometry.
The session file
The session file is included because some things are read out of there. Here's how it works. Line 0 opens up with info [Tab] 0. This means info is on line 0. Better leave it there. Since we see things zero based one is actually zero. So line #6 is actually number 5 starting from 0. You can safely delete items. Just make sure the number after the tab is the correct line.
· Kommander 1.3.1
· A running cron daemon
· A realization that this is a piece of one of my applications, not a finished
program. So while it will work out of the box, you'll get more out of it as a
cornerstone of your own development.