Using KonsoleKalendar to Interact With KOrganizer

dcp's picture

KonsoleKalendar lets you interact with the calendar application in KDE's Kontact from the command-line. Aside from possibly using this handy utility via SSH to remotely add an event to your calendar, you could probably also use it in a Bash, Python, or other script.

First, make sure you have KonsoleKalendar Installed. Using Adept on my gNewsense (the KDE version) system, I ran Adept to install it. You can then run the command konsolekalendar --help to see the list of options. As you can see, you can actually accomplish quite a bit from a Bash prompt. And the samples at the bottom are very instructive. And, by the way, most of the Kontact apps have some sort of Command-Line functionality that you can take advantage of should you need to.

For instance, following the example for adding an event, I ran:
konsolekalendar --add --date 2007-12-01 --time 10:00 --end-time 12:00 --summary "CharLUG Meeting" --description "Attend Charlotte Linux User Group meeting"

For Bash novices, remember to use a "\" character when you reach the end of a line, in order to continue your command entry on a new line.

To view a listing of events for a set range, simply use this option:
konsolekalendar --view --date 2007-11-25 --end-date 2007-11-30

Since the result of this command is a list printed to stdout (the console), you may want to pipe it to less:
konsolekalendar --view --date 2007-11-25 --end-date 2007-11-30 | less
to page through it one screen at a time.

You can modify events using the --change flag:
konsolekalendar --change --uid KonsoleKalendar-2105716492.854 --location "Central Piedmont Community College"

Note that the UID may show "libkcal" if the entry had been entered using the GUI, rather than KonsoleKalendar.

Need to export your current calendar to HTML? No sweat!
konsolekalendar --export-type HTMLmonth --export-file ~/docs/cal_dec-2007.html

But it's almost December! I need to post next December's calendar, for cryin' out loud! Hey, KonsoleKalendar's got you covered:
konsolekalendar --date 2007-12-01 --end-date 2007-12-31 --export-type HTMLmonth --export-file ~/docs/cal_dec-2007.html

You could just use HTML as the export type, but using the HTMLmonth type gives you a nicely-formatted table.

Well, I just thought you might like to know some of the cool stuff you can do with KonsoleKalendar. In your own time, you might play around with the idea of a Bash script that exports the current or upcoming month to an HTML file, calls an FTP or SSH client to upload it to the appropriate remote URL, and then calls KMail to send an e-mail to your closest contacts, letting them know the URL to check for your updated schedule. What ideas might you have for a handy tool like this?

If you actually try something like that, please feel free to post what you did and how you did it in the comments for this article!


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

wow. cool.

wow. cool.