LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   korganizer - Using a script with a reminder (https://www.linuxquestions.org/questions/programming-9/korganizer-using-a-script-with-a-reminder-807277/)

josephj 05-11-2010 10:27 PM

korganizer - Using a script with a reminder
 
Note: I also posted this in: KDE-Forum.org -> KDE ->(K)Office & PIM.
I wasn't sure whether to post it here under Software or Programming.

I tend to need early reminders for important events so I often set up events with reminders the morning of the event and one and two days in advance.

When korganizer displays a reminder for an event, i find it hard to read. I want to see the day name of the event (like "Today", "Tomorrow", or "Next Wednesday") and the name of the event (or be able to specify a custom image - that would be great). Instead, it tells me when the original event was scheduled (many of my events are recurring events and I have no interest in when I set them up a year ago) and the new date/time. I then have to look at a calendar to figure out what day it will be - kind of silly when I'm in a calendar application to start with.

I wasn't happy with this, so I wrote the following bash script.

Code:

#!/bin/bash
## korg_msg - Display a custom message when a calendar event occurs
## Copyleft 05/11/2010 JPmicrosystems

zenity --title "Scheduled Event" --info --text="${*}"
exit 0

Then, I went into one of my events and added a reminder for it.
In the reminder, I selected the Application/Script radio button and entered korg_msg as the script name (it's in my path) and "WNYLUG Meeting Wednesday Night" in the Arguments field.

This *almost* works great and, obviously, I can enhance the script later as needed - maybe even get it to display a custom image or icon so I know immediately what the event is.

The problem is that when the reminder occurs, the standard reminder window is still displayed and completely covers the new window that zenity produces and that also means that I have to close two windows now instead of one.

Is there a way to prevent the original reminder window from being displayed so that just my custom reminder shows up?
Since selecting the radio button for Application/Script automatically deselects the button for Display Reminder, I would have thought that this would be the default behavior.

If I can't disable the original reminder window, is there a way to get my new zenity window to display on top of it?

Is there a way my custom script can find and close the original reminder window (without causing any complications)?

I coded the script in bash/zenity, but if some other approach would be better, I'm open to it.

Of course, I'd like to have my cake an eat it and still be able to suspend a reminder if I want to. My script might be able to hanlde this if it can decide whether or not to close the reminder window and my window is on top.

If I (we) could get this to work right, it could be something that would appear like a major enhancement to end users for a relatively minimal investment in coding.

Thanks.

Joe - kubuntu karmic (x86) - kde 4.3.5

Sergei Steshenko 05-11-2010 10:48 PM

AFAIR, windows have "front" attribute which can be set. So I would start digging how to set the attribute - a number of times if necessary, i.e. if the KDE windows is created after the 'zenity' one.

josephj 05-12-2010 06:29 PM

Thanks. From what I can see, none of the "dialog" utilities I am aware of have an option for setting a "front" attribute (or any other window attribute for that matter).

I'm sure this can be done in some other programming languages or utilities. Any suggestions - especially examples I can copy?

I don't know perl or python. I did a bit of c programming a long time ago, but no gui stuff.

Joe


All times are GMT -5. The time now is 04:13 PM.