
90
|
Chapter 4, Related to X
#27 Make Applications Trigger On-Screen Alerts
HACK
Now follow these steps to configure KMail to execute the script when new
mail arrives:
1. Start up KMail and then click Settings
➝ Configure KMail.
2. Click the button entitled Other Actions at the bottom of the dialog,
located right below the Detailed New Mail Notification box, which
should be checked by default.
3. Click the More Options button at the bottom of the next dialog box
that appears.
4. Check the “Execute a program” box.
5. Enter
~/youhavemail in the edit field for this selection.
6. Click the Apply and/or OK buttons until you are back to the KMail
interface.
Jpilot
You can configure the Jpilot personal information manager (PIM) to run a
script that displays an on-screen message when a scheduled event occurs. Fire
up your favorite editor, and enter this script into a file called ~/jpilotalert. (This
script executes from your home directory, so you don’t need any special privi-
leges for it to work.)
#!/bin/bash
# figure out which display we're currently using
# then export the DISPLAY environment variable
HOST="$(xrdb -symbols | grep SERVERHOST | cut -d= -f2)"
DISPLAYNUM="$(xrdb -symbols | grep DISPLAY_NUM | cut -d= -f2)"
THISDISPLAY=$HOST:$DISPLAYNUM.0
export DISPLAY=$THISDISPLAY
echo "You have an appointment scheduled for $1 $2"'!' | osd_cat -s 2 -c
yellow -p middle \
-f -adobe-helvetica-bold-r-normal-*-*-240-*-*-p-*-*-* ...