# The &kalarm; Handbook

David
Jarvie

    software@astrojar.org.uk

David
Jarvie

    software@astrojar.org.uk

Developer
David
Jarvie

    software@astrojar.org.uk

Translator
2001
2002
2003
2004
David Jarvie
&FDLNotice;
2004-06-24
1.01.00

&kalarm; is a personal alarm message, command and email scheduler for &kde;.

KDE
kdepim
kalarm
alarm
reminder

## Introduction

&kalarm; is a personal alarm message, command and email scheduler. It lets you set up personal alarm messages which pop up on the screen at the chosen time, or you can schedule commands to be executed or emails to be sent.

In its default graphical mode, &kalarm; displays the list of pending alarms, showing their times and details. You can create new alarms, or you can select existing alarms for modification or deletion. You can also optionally view expired alarms.

When setting up or modifying an alarm, you may either type in the alarm message text, specify a text or image file to display, specify a command to execute, or enter an email to send. You can also choose the colour of the alarm message, whether it should repeat, whether to play a sound, and whether the alarm should be cancelled if it cannot be triggered at its scheduled time.

Alarms may also be scheduled from the command line, or via &DCOP; calls from programs.

When an alarm message is due, it is displayed on each &kde; desktop to ensure that you don't miss it. The message window shows the time for which the alarm was scheduled. It usually has a defer option to ask for the alarm to be displayed again later. An example of an alarm message:

Screenshot of the &kalarm; message window
Alarm message

When the alarm specifies a command to execute or an email to send, &kalarm; displays nothing.

&kalarm; can run in either of two modes: continuous (the default) where it runs from the &kde; system tray, or on-demand where it runs as and when required (with the option of displaying an independent system tray icon).

This document makes various references to the alarm daemon. This is an application which runs in the background, checking pending alarms and telling &kalarm; to display them when they become due.

## Using &kalarm;

When it is run with no command line parameters, &kalarm; starts in graphical mode, and displays the current list of outstanding alarms.

When &kalarm; starts in graphical mode, it checks whether the alarm daemon is running. If it is not already running, &kalarm; starts it.

All spin boxes in &kalarm; have an acceleration facility. To make the value change by larger steps, hold down the Shift key while you click on the spin arrow buttons.

### Alarm list

The main &kalarm; window displays the current list of pending alarms, showing their times, repetition intervals, colours, and message texts, names of files to display, commands to execute or email subjects. (For a recurring alarm or an alarm with a reminder, the time shown is its next scheduled trigger time.) An icon at the left of each alarm text/file/command/email subject indicates the type of alarm.

Screenshot of the &kalarm; main window
Main window

For a repeated alarm, the list shows its next scheduled trigger time and its basic repetition interval (&eg; 1 Day for a daily recurrence, 3 Weeks for a recurrence which triggers on Monday and Wednesday every third week, Login for a repeat-at-login alarm).

The alarms may be ordered by date/time, repeat interval, colour or text by clicking on the titlebar for the appropriate column. To reverse the sort order, click the column titlebar again.

You can optionally show the remaining time until each alarm is due, together with, or instead of, the alarm's scheduled time. To show or hide the alarm time column, select View Show Alarm Times. To show or hide the time-to-alarm column, select View Show Time To Alarms. At least one of these columns is always shown.

Expired alarms may be shown in the alarm list by selecting View Show Expired Alarms. To hide them again, repeat the action.

### Creating and manipulating alarms

#### Creating a new alarm

To create a new alarm, do one of the following. This displays the alarm edit dialogue through which you configure the alarm.

- Select Actions New.

- Right click on the system tray icon and choose New from the context menu.

- Click the Middle mouse button on the system tray icon.

- Right click in the alarm list and choose New from the context menu.

- Double click on empty space below the last entry in the alarm list.

Alternatively, you can create new alarms preconfigured from various sources:

- To base your new alarm on an alarm template, display the alarm edit dialogue as described above, and then click Load Template. Select a template from the list which appears and click OK. The alarm edit dialogue is then preset with the details from the selected alarm template, which you can now edit as required.

- To base your new alarm on an existing one, highlight the existing alarm in the list and select Actions Copy. This opens the alarm edit dialogue already filled in with a copy of the selected alarm's details.

- To create a new alarm which displays an existing email message, drag the email from &kmail; onto &kalarm;'s main window or system tray icon. This opens the alarm edit dialogue with the entire email message (including sender, recipient etc.) as the alarm text.

- Dragging any piece of text onto &kalarm;'s main window or system tray icon opens the alarm edit dialogue and sets the alarm text.

- To create a file display alarm, drag a file URL onto &kalarm;'s main window or system tray icon. This opens the alarm edit dialogue and sets the file name.

- You can automatically create birthday alarms for people in &kaddressbook; as described in Importing birthdays from &kaddressbook;.

#### Modifying an existing alarm

To modify an existing pending alarm (expired alarms cannot be amended), do one of the following:

- Double click on its entry in the alarm list.

- Select it by clicking on its entry in the alarm list. Then choose Actions Edit.

- Right click on its entry in the alarm list and choose Edit from the context menu.

This displays the alarm edit dialogue.

#### Deleting an alarm

To delete existing alarms, do one of the following:

- Select one or more alarms by clicking on their entries in the alarm list. Then choose Actions Delete .

- Right click on the desired entries in the alarm list and choose Delete from the context menu.

#### Viewing an alarm

To view an existing alarm without the ability to modify it, do one of the following:

- Select it by clicking on its entry in the alarm list. Then choose Actions View .

- Right click on its entry in the alarm list and choose View from the context menu.

This displays the alarm edit dialogue in read-only mode.

#### Acknowledging an alarm

See Alarm message window for how to acknowledge alarms.

#### Alarm templates

If you frequently want to set up similar alarms, you can create an alarm template to avoid having to enter all the details from scratch each time. A template can contain all the details which an alarm can contain, apart from the start date.

As an example, you may regularly want to set an alarm to remind you about a television programme whose time varies from week to week. The template would contain all the alarm details (message text, whether to play a sound etc.) except for the time and date. Now, to create the alarm, all you need to do is in the alarm edit dialogue load that template and then enter the time and date.

##### Configuring templates

You can create, modify or delete templates using the Alarm Templates dialogue, or you can create a new alarm template based on an existing alarm.

To create a new alarm template, do one of the following:

- Display the Alarm Templates dialogue by selecting the File Templates... menu item, and click New. This displays a blank template edit dialogue.

- Display the Alarm Templates dialogue by selecting the File Templates... menu item, select an existing template from the list and click Copy. This opens the template edit dialogue already filled in with a copy of the existing template's details.

- Highlight an alarm in the alarm list and select Actions Create template . This opens the template edit dialogue already filled in with a copy of the selected alarm's details.

To modify an existing template, display the Alarm Templates dialogue by selecting the File Templates... menu item and click Edit. This displays the template edit dialogue which is described below.

To delete existing templates, display the Alarm Templates dialogue by selecting the File Templates... menu item, select one or more templates and click Delete. A confirmation prompt is issued to prevent accidental deletions.

##### Template edit dialogue

The template edit dialogue is similar to the alarm edit dialogue. The following controls are different:

- Enter the template's name in Template name. It is the template's name which is displayed in template selection lists, so it is best to choose a name which will remind you of its function. Each template's name must be unique.

- In the Time group box, select one of:

  - Default time if you do not wish to specify any trigger time. Alarms based on this template will initially use the normal default trigger time for new alarms.

  - Time to enter a time when the alarm is to be triggered.

  - Any time to specify that the alarm should only have a date, not a time.

- In the Recurrence Rule group box in the Recurrence tab, no day or month need be selected for weekly or yearly recurrences, respectively.

#### Importing birthdays from &kaddressbook;

You can set up display alarms for birthdays stored in &kaddressbook;, by File Import Birthdays.... This displays a dialogue which allows you to select which birthdays to create alarms for.

- In the Alarm Text group box, you can set up the text to be displayed in the birthday alarm messages. The message text is created by combining the Prefix text followed by the person's name followed by the Suffix text. No spaces are added, so remember to include any necessary trailing space in Prefix and leading space in Suffix.

  If you change the alarm text, the birthday selection list will be re-evaluated.

- In the Select Birthdays list, select the birthdays which you want to create alarms for. Note that the list shows only those entries in &kaddressbook; which contain a birthday and which do not already have a birthday alarm in format currently defined in the Alarm Text group box.

- The remaining controls are the same as for Text alarms in the Alarm Edit dialogue.

### The alarm edit dialogue

The alarm edit dialogue enables you to view and edit an alarm.

Screenshot of the alarm edit dialogue
Alarm edit dialogue

#### Alarm action

In the Action group box, select the type of alarm:

- Text in order to enter an alarm message text (which may include newlines) in the edit box. Set the following options:

  - The Confirm acknowledgement tickbox lets you specify whether you will be prompted for confirmation when you close the alarm message window. This may be used as a safeguard against accidental acknowledgement of alarms.

  - Tick Sound if you want an audible alarm to sound when the alarm message is displayed. By default a beep is sounded; use the button on the right to select an audio file to play. To revert to a beep, click the button again. To see what your current sound selection is, hover the mouse above the button until a tooltip appears.

    If you have selected an audio file to play, there are further options to control the sound:

    - Tick Repeat to continually repeat the audio file for as long as the alarm is displayed. (The alarm message window contains a button to stop playing the sound should you need silence but still want to display the alarm.)

    - Tick Volume and adjust the slider control if you want to adjust the volume at which the audio file is played.

      You can use the Try button to test out the resultant sound level.

  - Tick Reminder if you want to display a reminder in advance of the main alarm and of each of its recurrences (if any). Enter how long in advance using the edit controls beside the tickbox.

    If the alarm recurs, tick Reminder for first recurrence only if you only want a reminder before the alarm's first recurrence. If this is not ticked, the reminder period is limited to being less than the recurrence interval.

  - Select the background colour for the alarm message window. (The colour selection list can be configured in the Preferences dialogue.)

  - Use the Font & Colour... button to select a font, or foreground or background colour, for the alarm message. In the Choose Alarm Font & Colour dialogue, tick Use default font to display the message in whatever font is configured as the default at the time the message is displayed. (The default font can be set in the Preferences dialogue.) To choose a specific font for the message, untick Use default font.

  - Use the Special Actions... button to specify shell commands to execute before or after displaying the alarm. In the Special Alarm Actions dialogue:

    - In the Pre-alarm action field, enter a shell command to execute before the alarm is displayed. Note that &kalarm; will wait for the command to complete before displaying the alarm.

    - In the Post-alarm action field, enter a shell command to execute when the alarm window is closed.

    See the description of Command alarms below for details of how shell commands are executed.

    Note that special actions are not executed if the alarm was displaying at the time you logged off and is then restored when you log in.

- File to enter the name or &URL; of a text or image file whose contents are to be displayed in the alarm message. Use the button beside the edit box to display a file selection dialogue. Set options as for text alarms above.

- Command to enter a shell command line to execute. The command is passed straight to the default shell (defined by the `SHELL` environment variable), and may include whatever options, parameters, piped commands etc. are permitted by the shell in a single line command.

  This option is not available if &kde; is running in kiosk mode.

- Email to enter an email message to send. Fill in the recipients' addresses, the email subject line and the message body in the three edit fields. Use the button beside the addressee edit box to display your &kde; address book from which you can select email recipients. Attachments may be added using the Add... button. Note that attached files must still exist when the alarm is triggered; no copy is stored at the time the alarm is configured. To remove an attachment, highlight it in the drop-down list and click the Remove button.

  You can set your email address from which the email is sent, in the Preferences dialogue, the default being your email address set in the &kde; Control Centre.

  Set the following option:

  - Tick Copy email to self to send a blind copy of the email to yourself when the alarm is triggered. The email address to which the copy will be sent may be set in the Preferences dialogue, the default being your email address set in the &kde; Control Centre.

#### Deferral

If the alarm is a recurring alarm and it was deferred after it was last displayed, the Deferred Alarm group box shows the time the alarm was deferred to. Change... displays a dialogue which allows you to change the deferred time or to cancel the deferral.

#### Time

In the Time group box, select either

- At date/time to enter the date and time when the alarm is to be triggered. Tick Any time if you want to specify only a date for the alarm: in this case the alarm will be displayed at the first opportunity on or after the configured start-of-day time, on the specified date. (Configuring &kalarm; describes how to set the start-of-day time.)

  For a non-recurring alarm, the date/time which you enter must be in the future, or if you enter only a date it must be today or later. For a recurring alarm, there are no such restrictions since the start date/time will be automatically adjusted to the first recurrence due after the current time.

- Time from now to enter how long after now (in hours and minutes) the alarm should be triggered.

#### Recurrence

The alarm's basic repetition characteristic is displayed for convenience in the Alarm tab. Specify whether or how the alarm should be repeated in the Recurrence tab:

- In the Recurrence Rule group box, set the recurrence type or time period as follows:

  - To trigger the alarm once only, select No recurrence.

  - Select At login to trigger the alarm whenever you log in, until its scheduled end time. Then, at its scheduled end time it will finally be triggered one last time. (Note that an alarm repeated at login will also be triggered any time you enable alarms, or restart or reset the alarm daemon.)

  - To make the alarm recur at regular intervals, select one of the time period types and then enter in the Recur every box how many time periods should elapse between recurrences. For example, to repeat every fortnight, you could select Daily and enter a value of 14, or select Weekly and enter a value of 2. Depending on the time period type selected, you may have further options:

    - For a weekly recurrence, tick each day in the week on which you wish to trigger the alarm.

    - For a monthly recurrence, you may select either a fixed date, or a position (&eg; the second Tuesday).

    - For a yearly recurrence, you may select either a fixed day in the month, or a position in a month (&eg; the last Saturday in May). Tick each month of the year in which you wish to trigger the alarm.

    To set a daily alarm to occur only on weekdays, use a weekly recurrence and tick each weekday.

- In the Recurrence End group box, set the overall recurrence time span as follows:

  - Select No end to continue the repetitions indefinitely.

  - Select End after to specify the total number of occurrences of the alarm.

  - Select End by to specify the date/time until which the alarm will be repeated.

- If you wish to exclude certain date/times from the recurrence which you have set up, specify them in the Exceptions group box. The list of exceptions (&ie; excluded date/times) is shown on the left. To add a new exception, enter a date on the right and press Add. To change an exception, highlight it in the list, enter the new date on the right and press Change. To delete an exception, highlight it in the list and press Delete.

#### Other controls

The Cancel if late tickbox determines what happens if the alarm cannot be triggered at its scheduled time. Tick this box to cancel the alarm if it cannot be triggered within one minute after the right time. Leave the box unticked to trigger the alarm at the first opportunity starting at the scheduled time. Date-only alarms, &ie; ones for which the Any time option is selected, will be cancelled if they cannot be displayed within 24 hours of the start-of-day time on the date scheduled.

An alarm can only be triggered while you are logged in, and while both X and the alarm daemon are running.

Press the Load Template button to select a template to preset the dialogue with, as described in Creating and manipulating alarms.

Press the Try button to test the alarm and check whether it works correctly. The alarm is executed just as if it had been scheduled in the normal way.

Press the OK button when all details are correct, to add the alarm to the scheduled list.

### Alarm message window

When an alarm message is due, it is displayed on each &kde; desktop and cannot be covered by ordinary windows, to ensure that you see it. The message window shows the time for which the alarm was scheduled, so that you can see when it popped up if you were away from the computer at the time. (For reminder messages, however, the date/time shown is that for the main alarm or its recurrence, not the reminder message time, and the window title is Reminder).

In the case of a recurring alarm, if an unacknowledged message window remains from a previous occurrence of the alarm, the existing window is simply popped up when the alarm recurs. This avoids having to acknowledge multiple copies of the same message should you not wish, or be unable, to acknowledge a message at the time it appears.

The alarm message window provides the following options:

- Acknowledge the alarm by clicking the Close button. This closes the window (after a prompt for confirmation, if you selected Confirm acknowledgement).

- Display options to defer the alarm until later by clicking the Defer... button. Then select Defer to date/time to enter the date and time when the message is to be redisplayed, or select Defer for time interval to enter how long after now (in hours and minutes) the message should be redisplayed. Then click Defer to defer the alarm message.

  The time the alarm is deferred to must be earlier than its next scheduled occurrence or next reminder.

  The Defer... button is not available for alarms which are displayed at login due to the Repeat at login option having been selected.

- Stop playing the alarm's sound file by clicking the button showing the stop playing symbol. Clicking it has no effect on the alarm message window.

  This button only appears when the alarm has a sound file specified.

- The button showing the &kalarm; icon provides a convenient way to activate &kalarm;. Clicking it has no effect on the alarm message window.

The alarm message window may be displayed in two different modes, depending on your preferences. You can choose the mode in the Preferences dialogue.

- As a normal window. In this mode, the keyboard focus is taken by the alarm message window when it appears, so if you are typing at the time your keystrokes will be diverted to it rather than your original application.

- As a non-modal window. In this mode, the keyboard focus is unaffected when the alarm message window appears, so it will not interfere with your typing. However in this mode the window has no titlebar, so you cannot move it.

### System tray operation

&kalarm; may be run as an icon in the &kde; system tray. This icon allows one-click activation of &kalarm;, and provides both control and status indication of alarm monitoring. A normal &kalarm; icon indicates that alarms are being monitored, while a grey icon indicates that alarms are not being monitored.

If you hover the mouse cursor over the system tray icon, a summary of the first few message alarms due in the next 24 hours are displayed as a tooltip. You can switch this feature off, or configure the number of alarms to display and their format, in the Preferences dialogue.

Left click on the system tray icon to toggle between displaying and hiding the &kalarm; main window.

Right click on the system tray icon to display its context menu:

Enable Alarms

  Enables monitoring of alarms.

  See Enabling/disabling alarm monitoring for details.

Alarms Enabled

  Disables monitoring of alarms.

  See Enabling/disabling alarm monitoring for details.

New Alarm...

  Opens the alarm edit dialogue to create a new alarm.

  See The alarm edit dialogue for details.

Configure &kalarm;...

  Displays the &kalarm; preferences dialogue.

  The preferences dialogue is described in Configuring &kalarm;. It includes options relating to the &kalarm; system tray icon.

Control Alarm Daemon...

  Displays the Service Manager dialogue which allows you to control the alarm daemon.

  See Controlling the alarm daemon with the Service Manager for details.

Restore / Minimise

  Restores or minimises the main &kalarm; window.

  This option is only available if the run mode is continuous. (See Configuring &kalarm; for a description of run modes.)

Quit

  Closes the &kalarm; system tray icon.

  In continuous run mode only, it also closes all &kalarm; main windows. It has no effect on the monitoring of alarms by the alarm daemon, if you have deselected Disable alarms while not running in the Preferences dialogue.

#### Displaying &kalarm; in the system tray

You must be running the &kde; desktop in order to display &kalarm; in the system tray. If &kalarm; is running in continuous mode, the system tray icon is always displayed. These instructions apply only to on-demand mode. (See Configuring &kalarm; for a description of run modes.)

To display &kalarm; in the &kde; system tray, select View Show in System Tray .

To remove &kalarm; from the &kde; system tray, do one of the following:

- Select View Hide from System Tray.

- Right click on the system tray icon and choose Quit from the context menu.

Use of the system tray icon is described below.

### Refreshing alarms

If in the unlikely event that any alarm was not triggered when it should have been, you can refresh the alarm list and trigger any missed alarms by selecting Actions Refresh Alarms .

&kalarm; retriggers missed alarms by resetting the alarm daemon, which is discussed in the Alarm daemon section.

### Enabling/disabling alarm monitoring

#### Enabling alarm monitoring

If &kalarm;'s run mode is continuous and you have selected Disable alarms while not running in the Preferences dialogue, you must first ensure that &kalarm; is running in order for alarm monitoring to take place.

Then if alarm monitoring is currently disabled, do one of the following:

- Select Actions Enable Alarms.

- Right click on the system tray icon and choose Enable Alarms from the context menu.

The alarm daemon is started if necessary and alarms will be monitored for when they become due.

Starting the alarm daemon will affect any other applications which use the alarm daemon.

#### Disabling alarm monitoring

There are several ways to disable alarm monitoring, which prevents &kalarm; from displaying any further alarms either until you re-enable alarms, or - assuming that the alarm daemon is configured to start at login - until the next time you log in.

To disable alarms without stopping the alarm daemon (and therefore without affecting any other applications which use the alarm daemon), do one of the following:

- Select Actions Alarms Enabled.

- Right click on the system tray icon and choose Alarms Enabled from the context menu.

- If &kalarm;'s run mode is continuous and you have selected Disable alarms while not running in the Preferences dialogue, quit &kalarm;.

To disable alarms by stopping the alarm daemon:

- Select Settings Control Alarm Daemon.... This displays the Service Manager dialogue which enables you to stop the alarm daemon.

This will affect any other applications which use the alarm daemon.

### Controlling the alarm daemon

To control the alarm daemon, select Settings Control Alarm Daemon.... This displays the Service Manager dialogue which allows you to stop or start the alarm daemon and configure whether it runs automatically at login. See Controlling the alarm daemon with the Service Manager for details.

### Quitting the program

Quit &kalarm; by closing all its windows and the system tray icon, or if it is running in continuous mode, by closing any message windows and selecting File Quit, or Quit in the system tray icon context menu.

The effect of File Quit or of the system tray icon context menu item Quit depends on the run mode: in on-demand mode it hides the system tray icon, while in continuous mode it quits the program.

If you have deselected Disable alarms while not running in the Preferences dialogue, quitting &kalarm; has no effect on the alarm daemon which if already active will continue to monitor scheduled alarms and request their display when they become due.

## Configuring &kalarm;

To configure &kalarm;'s operation to suit your system and your personal preferences, select Settings Configure &kalarm;.... This displays the configuration dialogue.

### General

The General section lets you control &kalarm;'s overall behaviour:

- Run Mode group box: These options control &kalarm;'s system tray icon, and also allow some control over &kalarm;'s use of system resources by specifying whether or not to run it continuously. If system performance is of concern, running it on demand without displaying the system tray icon may be desirable; running it continuously in the system tray uses more system resources but gives the benefits of displaying an alarm-enabled indication and making the application more accessible. Running &kalarm; on demand does not affect the execution of alarms, since it is the alarm daemon and not &kalarm; which monitors the alarm list and triggers alarms.

  - Run continuously in system tray: &kalarm; runs continuously and the system tray icon is always displayed while it is running. In this mode, closing the system tray icon closes all &kalarm; main windows, and if no message windows are visible, quits the application. The options available in this mode are:

    - Autostart at login: This starts &kalarm; at &kde; session login, ensuring that &kalarm; runs at all times unless you manually quit.

    - Disable alarms while not running: Selecting this option has the effect that alarms will be disabled whenever &kalarm;'s system tray icon is not visible.

      - Warn before quitting: When alarms are disabled while &kalarm; is not running, selecting this option prompts you for confirmation if you attempt to terminate &kalarm; using the system tray icon's Quit option. This prevents accidental disabling of alarms. For safety, this option is automatically re-enabled by default whenever you change run mode.

    In this mode, if no &kde; system tray exists, &kalarm; runs continuously in the background and alarms are always enabled.

  - Run only on demand: &kalarm; is run only when an alarm is triggered, if you run it manually, or while its system tray icon is displayed. In this mode the system tray icon can still be displayed, but closing the system tray icon has no effect on any &kalarm; windows.

    - Autostart system tray icon at login: This displays &kalarm;'s system tray icon at login. &kalarm; will run until the system tray icon is closed.

- Start of day for date-only alarms: Set the start-of-day time for the purposes of triggering date-only alarms, &ie; ones for which the Any time option was selected. On the date when they are due, such alarms will be output at the earliest opportunity during the 24 hours starting from the start-of-day time.

- If you set up yearly recurrences for February 29th, specify how these are to be handled in non-leap years by selecting one of the following options:

  - February 28th: the alarm will occur on February 29th in leap years, and on February 28th in non-leap years.

  - March 1st: the alarm will occur on February 29th in leap years, and on March 1st in non-leap years.

  - Do not repeat: the alarm will occur on February 29th in leap years, but will be suppressed in non-leap years.

  Changing this option will not cause the next scheduled recurrence of any existing alarms to be re-evaluated. It will only affect new alarms, or existing alarms after they are next triggered.

- Confirm alarm deletions: Specify whether you should be prompted for confirmation each time you delete an alarm.

- Expired Alarms group box: These options control the storage of expired alarms.

  - Keep alarms after expiry: Select this option to store expired alarms. Deselect it to keep no record of alarms once they have expired.

  - Discard expired alarms after: Set the number of days to store expired alarms after their last activation.

  - Clear expired alarms: This button discards all currently stored expired alarms. This has no effect on alarms which subsequently expire; they will continue to be stored according to the selected options.

### Email

The Email section lets you choose options for sending and addressing email alarms:

- Email client: Specify the email client to be used to send email alarms:

  - KMail: When an email alarm is triggered, the email is sent using KMail as follows:

    - If &kmail; is running at the time and &kmail; is version 1.7 or later, the email is sent automatically.

    - If &kmail; is running at the time and &kmail; is an older version, the email is added to &kmail;'s `outbox` folder for later transmission.

    - If &kmail; is not running, a &kmail; composer window is displayed filled in with the email details, to enable you to send the email manually.

  - Sendmail: When an email alarm is triggered, the email is sent automatically using sendmail. This option will only work if your system is configured to use sendmail, or a sendmail compatible mail transport agent such as postfix or qmail.

- The From email address specifies your email address to be used as the sender's address in email alarms. Select Use address from Control Centre to use the email address which is configured in the &kde; Control Centre.

- The Bcc email address specifies your email address to be used for sending blind copies of email alarms to yourself when the Copy email to self option is selected. If blind copies are to be sent to your account on the computer which &kalarm; runs on, you could simply enter your user login name here. Select Use address from Control Centre to use the email address which is configured in the &kde; Control Centre.

- Notify when remote emails are queued: Select this option to display a notification whenever an email alarm queues an email for sending to a remote system. This may be useful if, for example, you have a dial-up connection, or email is queued in &kmail;'s `outbox` folder, so that you can ensure that you do whatever is needed to actually transmit the email.

### View

The View section lets you control some aspects of &kalarm;'s appearance:

- Alarm List group box: These options control what information is initially shown in the alarm list, when &kalarm; starts up. (Once &kalarm; has started, use the View menu to change what is displayed.)

  - Show alarm time: Select this option to show the date and time at which each alarm is next scheduled.

  - Show time until alarm: Select this option to show the length of time remaining before each alarm's next scheduled occurrence. The length of time is shown in days (if applicable), hours and minutes.

- System Tray Tooltip group box: These options control what information is shown in the tooltip which appears when the mouse cursor hovers over &kalarm;'s system tray icon.

  - Show next 24 hours' alarms: When selected, a summary of the first few alarms due in the next 24 hours is displayed.

  - Maximum number of alarms to show: Deselect this option to display all of the next 24 hours' alarms. Select it to set the maximum number of alarms which will be displayed.

  - Show alarm time: Select this option to show the time at which each alarm is scheduled.

  - Show time until alarm: Select this option to show the length of time remaining before each alarm's next scheduled occurrence. The length of time is shown in hours and minutes.

    - Prefix: Specify a symbol or text to show in front of the length of time until the alarm, to distinguish it from the time at which the alarm is scheduled.

- Message windows have a title bar and take keyboard focus: This option controls whether alarm message windows are modal or not, &ie; whether they grab the keyboard focus when they appear. See the Alarm message window section for details.

- Show expired alarms: Select this option to initially show expired alarms in the alarm list, when &kalarm; starts up. (Once &kalarm; has started, use the View Show Expired Alarms menu option to change what is displayed.)

- System tray icon update interval: Set the frequency at which the &kalarm; system tray icon is updated to reflect whether alarms are currently being monitored. This involves checking whether the alarm daemon is running.

### Font & Colour

The Font & Colour section lets you set the default appearance of alarm messages, and the colours to be used in the alarm list:

- Select the default font and background colour to use for alarm message display.

- Edit the colour selection list which is displayed when you click on the background colour combo box:

  - Add colour...: Displays a colour selection dialogue which lets you choose a colour to add to the list.

  - Remove colour: Removes the colour currently displayed in the Background colour combo box from the list. The Custom colour item cannot be removed from the list, and when it is displayed, this button is disabled.

- Select the colour to be used in the alarm list to show expired alarms.

### Edit

The Edit section lets you choose default values for the options in the alarm edit dialogue:

- Set the text colour used to show expired alarms in the alarm list.

- Set the default states for the Cancel if late, Confirm acknowledgement and Copy email to self tickboxes.

- Set the default sound options. Note that a default sound file may be specified even if Sound is unticked or Beep is ticked.

- Set the default recurrence type.

- Set the default reminder period units.

- Set the default special display alarm actions.

## Command line operation

When command line parameters are supplied, &kalarm; does not display the list of scheduled alarms as described in Using &kalarm; above. Command line options specific to &kalarm; may be used to perform the following operations:

- schedule a new alarm

- control the alarm daemon

- control &kalarm;'s display mode

- obtain help

Additional command line options are provided primarily to enable other programs to interface to &kalarm;. They are described in the chapter Developer's Guide to &kalarm;.

The command line must only contain options applicable to one &kalarm; operation. If you want to perform multiple operations, you must invoke &kalarm; multiple times with a single set of options each time.

### Schedule a new alarm

The following options are used to schedule a new alarm:

Option | Description
--- | ---
`-a`, `--ack-confirm` | Prompt for confirmation when the alarm message is acknowledged.
`-A`, `--attach URL` | Specify the name or &URL; of a file which is to be attached to the email. This option may be repeated as necessary. `--mail` must be specified with this option.
`-b`, `--beep` | Make an audible beep when the message is displayed. `--play` and `--play-repeat` cannot be specified with this option.
`--bcc` | Blind copy the email to yourself. `--mail` must be specified with this option.
`-c`, `--color`, `--colour colour` | Set the message background colour to the specified &Qt; colour name or hex code 0xRRGGBB.
`-C`, `--colorfg`, `--colourfg colour` | Set the message foreground colour to the specified &Qt; colour name or hex code 0xRRGGBB.
`-e`, `--exec commandline` | Specify a shell command to execute. If specified, this option must be the last &kalarm; option in &kalarm;'s command line. All subsequent command parameters and options are interpreted as forming the command line to execute. `--file` and `--mail` cannot be specified with this option. `--ack-confirm`, `--beep`, `--color` and `--colorfg` are ignored with this option.
`-f`, `--file URL` | Specify the name or &URL; of a text or image file whose contents are to form the alarm message. `--exec` and `--mail` cannot be specified, and message must not be present with this option.

`-i`, `--interval period`

Set the interval between repetitions of the alarm. Hours/minutes are specified in the format nHnM, where n is a number, &eg; 3H30M. Other time periods are specified in the format nX, where n is a number and X is one of the following letters: Y (years), M (months), W (weeks), D (days). Mandatory if `--repeat` or `--until` is specified. `--recurrence` cannot be specified with this option.

`-l`, `--late-cancel` | Cancel the alarm if it cannot be triggered at the correct time.
`-L`, `--login` | Trigger the alarm every time you log in. `--interval`, `--repeat` and `--until` cannot be specified with this option.
`-m`, `--mail address` | Send an email to the specified address. This option may be repeated as necessary. `--exec` and `--file` cannot be specified with this option. `--ack-confirm`, `--beep`, `--color` and `--colorfg` are ignored with this option.
`-p`, `--play URL` | Specify the name or &URL; of an audio file to be played once when the alarm message is displayed. `--play-repeat` and `--beep` cannot be specified with this option.
`-P`, `--play-repeat URL` | Specify the name or &URL; of an audio file to be played repeatedly for as long as the alarm message is displayed. `--play` and `--beep` cannot be specified with this option.
`--recurrence spec` | Set the alarm to recur. Specify the recurrence using iCalendar syntax (defined in RFC2445), &eg; FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO. `--repeat`, `--interval`, and `--until` cannot be specified with this option.
`-r`, `--repeat count` | Set the number of times the alarm should be triggered. Specify -1 to repeat the alarm indefinitely. `--interval` must be, and `--until` and `--recurrence` cannot be, specified with this option.

`-R`, `--reminder period`

Output a reminder alarm the specified length of time before the main alarm and each of its recurrences (if any). Hours/minutes are specified in the format nHnM, where n is a number, &eg; 3H30M. Other time periods are specified in the format nX, where n is a number and X is one of the following letters: W (weeks), D (days). This option cannot be specified with `--exec` or `--mail`.

`-S`, `--subject subject` | The subject line of the email. `--mail` must be specified with this option.
`-t`, `--time date/time` | Trigger alarm on the date or at the date/time specified. Specify a date without a time in the format yyyy-mm-dd; specify a date and time by [[[yyyy-]mm-]dd-]hh:mm (where omitted, date fields default to the values for today).
`-v`, `--volume percentage` | Set the audio volume for playing the audio file. This option can only be used when `--play` or `--play-repeat` is specified.
`-u`, `--until date/time` | Repeat the alarm until the date or date/time specified. Specify a date without a time in the same format as for `--time`. `--interval` must be, and `--repeat` and `--recurrence` cannot be, specified with this option.
message | Message text to display or, if `--mail` is specified, the body of the email message.

Either a message text, `--file` or `--exec` must be specified; except as noted above, all the options are optional.

Two alternative examples which display a multi-line message with a red background at 10 p.m. on the 27th of this month are:

    % kalarm -c red -t 27-22:00 "Remember to\nSTOP"
    % kalarm -c 0xFF0000 -t 27-22:00 "Remember to\nSTOP"

### Other options

The following options are used to reset or halt the alarm daemon, or to control &kalarm;'s display mode.

See the Alarm daemon section for a discussion about resetting and stopping the alarm daemon.

Option | Description
--- | ---
`--reset` | Reset the alarm daemon.
`--stop` | Stop the alarm daemon.
`--tray` | Display &kalarm; as an icon in the &kde; system tray.

For example, to reset the alarm daemon:

    % kalarm --reset

### Help options

The following help options are common to all &kde; programs:

Option | Description
--- | ---
`--help` | Shows a brief options help text.
`--help-qt` | Shows numerous generic &Qt;-specific options.
`--help-kde` | Shows numerous generic &kde;-specific options.
`--help-all` | Shows all options.
`--author` | Shows the names and email addresses of &kalarm; authors.
`-v`, `--version` | Shows the running versions of the &Qt; library , &kde; and &kalarm;.
`--license` | Show licence information.

## Alarm daemon

The alarm daemon, &kalarmd;, monitors &kalarm;'s calendar file for alarms becoming due. When it determines that an alarm is due, it tells &kalarm; to display or execute it, or to cancel it if it is late and late trigger was not selected for that alarm.

Under &kde;3, the alarm daemon may also be used by other applications, including KOrganiser.

The alarm daemon runs in the background, with no user interface. It may be controlled as described below.

### Starting, resetting and stopping the alarm daemon

The alarm daemon is normally started at &kde; session login (unless you use the Service Manager dialogue to disable auto start), and runs continuously until logout. If for any reason it is not running, alarm monitoring will not occur and &kalarm; will not display or execute any alarms.

#### Starting the alarm daemon

To start the alarm daemon, you can either run &kalarm; in its default graphical mode (&ie; without any command line parameters), enable alarms using &kalarm;'s system tray icon menu, reset the daemon as described below, start it using the Service Manager dialogue (see Controlling the alarm daemon with the Service Manager) or you can run the alarm daemon directly from the command line:

    % kalarmd

#### Resetting the alarm daemon

It is also possible to reset the alarm daemon without stopping it. Resetting causes the alarm daemon to re-read the list of scheduled messages from the calendar file and re-initialise its &kalarm;-related data.

Why might you want to reset the alarm daemon? It isn't a very likely occurrence, but if for any reason &kalarm; was not able to run when the alarm daemon told it to trigger an alarm, that alarm will never be displayed or executed until the alarm daemon is either reset or restarted. Resetting is preferable to stopping the alarm daemon and restarting it, since resetting the daemon will not affect any other applications which use the alarm daemon.

Resetting starts the alarm daemon if it is not currently running.

To reset the alarm daemon, either use the menu command Actions Refresh Alarms or type the following command:

    % kalarm --reset

#### Stopping the alarm daemon

Stopping the alarm daemon will prevent any further monitoring of scheduled alarm messages until the daemon is restarted.

Stopping it will affect the functioning of any other applications which also use the alarm daemon. Consider resetting the daemon instead.

To stop the alarm daemon, either use the Service Manager dialogue (see Controlling the alarm daemon with the Service Manager), or type the following command:

    % kalarm --stop

### Controlling the alarm daemon with the Service Manager

The Service Manager dialogue allows you to configure and control the alarm daemon. You can:

- Configure whether it runs automatically at login.

  If neither the alarm daemon nor &kalarm; is configured to run at login, alarm monitoring will not occur and &kalarm; will not display or execute any alarms.

- Stop and start the alarm daemon.

  Starting or stopping the alarm daemon will affect any other applications which use the alarm daemon.

The Service Manager dialogue can be accessed either via the menu option Settings Control Alarm Daemon..., or via the &kde; Control Centre.

## Developer's Guide to &kalarm;

&kalarm; provides an interface to allow other applications to request the following functions:

- schedule a new alarm

- trigger or cancel an already scheduled alarm

- cancel an already scheduled alarm

- trigger an already scheduled alarm

Each of the above functions is implemented both by a &DCOP; call and by the command line. &DCOP; calls should be used in preference if &kalarm; is already running.

### &DCOP; interface

cancelEvent

#### cancelEvent

cancel an already scheduled alarm.

    void cancelEvent(const QString& calendarFile, const QString& eventID)

##### Parameters

`calendarFile`

  Specifies the &URL; of the calendar file containing the event to be cancelled.

`eventID`

  Specifies the unique ID of the event to be cancelled, as stored in calendarFile.

##### Description

`cancelEvent()` is a &DCOP; call to cancel the specified alarm. &kalarm; deletes the alarm from the calendar file without displaying or executing it.

The calendarFile parameter is only used for integrity checking: if the &URL; does not specify &kalarm;'s current default calendar file, the request will be ignored.

The old name for this function, `cancelMessage`, has been retained for compatibility, but all new applications should use `cancelEvent`.

triggerEvent

#### triggerEvent

trigger an already scheduled alarm.

    void triggerEvent(const QString& calendarFile, const QString& eventID)

##### Parameters

`calendarFile`

  Specifies the &URL; of the calendar file containing the event to be triggered.

`eventID`

  Specifies the unique ID of the event to be triggered, as stored in calendarFile.

##### Description

`triggerEvent()` is a &DCOP; call to trigger the immediate display or execution of the specified alarm (regardless of what time it is scheduled for). &kalarm; retrieves the alarm from the calendar file and then displays or executes it.

If the alarm is already due, &kalarm; then deletes all scheduled occurrences of the alarm up to the current time, and if no repetitions of the alarm still remain, the alarm is deleted from the calendar file. If the alarm is not due yet, its scheduled occurrences are left unchanged.

The calendarFile parameter is only used for integrity checking: if the &URL; does not specify &kalarm;'s current default calendar file, the request will be ignored.

The old name for this function, `displayMessage`, has been retained for compatibility, but all new applications should use `triggerEvent`.

handleEvent

#### handleEvent

trigger or cancel an already scheduled alarm.

    void handleEvent(const QString& calendarFile, const QString& eventID)

##### Parameters

`calendarFile`

  Specifies the &URL; of the calendar file containing the event to be displayed/executed or cancelled.

`eventID`

  Specifies the unique ID of the event to be displayed/executed or cancelled, as stored in calendarFile.

##### Description

`handleEvent()` is a &DCOP; call to display/execute or cancel the specified alarm. &kalarm; retrieves the alarm from the calendar file and then determines what action to take depending on when the alarm is due.

- If the alarm is not yet due, nothing happens.

- If the alarm is due, it acts as follows. If the late-cancel flag is set and the alarm is late, &ie; the scheduled trigger time was longer than one minute ago, &kalarm; does not display or execute the alarm; otherwise, &kalarm; displays or executes the alarm. If no repetitions of the alarm are still scheduled, &kalarm; then deletes the alarm from the calendar file.

The calendarFile parameter is only used for integrity checking: if the &URL; does not specify &kalarm;'s current default calendar file, the request will be ignored.

scheduleMessage

#### scheduleMessage

schedule a new alarm message.

    bool scheduleMessage(const QString& message, const QDateTime& dateTime, const QColor& bg, const QColor& fg, int flags, const QString& audioURL, int reminder, const QString& recurrence)

    bool scheduleMessage(const QString& message, const QDateTime& dateTime, const QColor& bg, const QColor& fg, const QFont& font, int flags, const QString& audioURL, int reminder, const QString& recurrence)

    bool scheduleMessage(const QString& message, const QDateTime& dateTime, const QColor& bg, const QColor& fg, int flags, const QString& audioURL, int reminder, int simpleRepeatType, int interval, int repeatCount)

    bool scheduleMessage(const QString& message, const QDateTime& dateTime, const QColor& bg, const QColor& fg, int flags, const QString& audioURL, int reminder, int simpleRepeatType, int interval, const QDateTime& endTime)

##### Parameters

`message`

  Specifies the text of the message to be scheduled.

`dateTime`

  Specifies the scheduled date and time at which the message should be displayed.

`bg`

  Specifies the background colour for displaying the message.

`fg`

  Specifies the foreground colour for displaying the message.

`font`

  Specifies the font for displaying the message.

`flags`

  Specifies the logical OR of the desired alarm message flags. The flag bits are those defined in class KAEvent in `alarmevent.h`

`audioURL`

  Specifies the name or &URL; of an audio file which is to be played when the message is displayed.

`reminder`

  Specifies the number of minutes in advance of the main alarm and of each of its recurrences (if any) at which a reminder alarm should be displayed. Specify 0 if no reminder is required.

`recurrence`

  Specifies a regular recurrence for the alarm, using iCalendar syntax as defined in RFC2445. For example, FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO would specify 4 repetitions at 3-monthly intervals on the last Monday of the month. For a non-recurring alarm, specify an empty string.

`simpleRepeatType`

  Specifies the recurrence type for the alarm. The permissible values are MINUTELY, DAILY, WEEKLY, MONTHLY_DAY, ANNUAL_DATE. These are defined in class KAEvent in `alarmevent.h`.

`interval`

  Specifies the number of periods (minutes/days/weeks/months/years) between repetitions of the alarm message.

`repeatCount`

  Specifies the number of times that the alarm message should be displayed. Specify -1 to repeat the alarm indefinitely.

##### Description

`scheduleMessage()` is a &DCOP; call to schedule the specified alarm message for display at the specified date and time. It has several forms. The two most general forms allow an arbitrary recurrence to be specified - use these also for non-repeating alarms. Either specify a font parameter, or none to use &kalarm;'s default font. The other forms provide convenient access to a restricted set of alarm recurrence types, one specifying a repetition count and the other an end time; both of these use the default font.

If the scheduled time (including any repetitions) has already passed, &kalarm; immediately displays the message or, if the LATE_CANCEL flag bit is set, ignores the request. If the scheduled time (or a repetition) is in the future, &kalarm; adds the alarm message to the calendar file for later display.

Use a code sequence similar to the following to set up the parameter data for the &DCOP; call to `scheduleMessage()` for a non-recurring alarm, or for a regularly recurring alarm using iCalendar syntax to specify its recurrence:

    QString message, audioFile, recurrence;
    QDateTime dateTime;
    QColor bgColour, fgColour;
    Q_UINT32 flags;
    Q_INT32 reminder;
    . . .
    QByteArray data;
    QDataStream arg(data, IO_WriteOnly);
    arg << message;
    arg.writeRawBytes((char*)&dateTime, sizeof(QDateTime));
    arg.writeRawBytes((char*)&bgColour, sizeof(QColor));
    arg.writeRawBytes((char*)&fgColour, sizeof(QColor));
    arg << flags << audioFile << reminder << recurrence;

Use a code sequence similar to the following to set up the parameter data for the &DCOP; call to `scheduleMessage()` for a regularly recurring alarm without using iCalendar syntax:

    QString message, audioFile;
    QDateTime dateTime;
    QColor bgColour, fgColour;
    Q_UINT32 flags;
    Q_INT32 reminder, repeatType, repeatCount, repeatInterval;
    . . .
    QByteArray data;
    QDataStream arg(data, IO_WriteOnly);
    arg << message;
    arg.writeRawBytes((char*)&dateTime, sizeof(QDateTime));
    arg.writeRawBytes((char*)&bgColour, sizeof(QColor));
    arg.writeRawBytes((char*)&fgColour, sizeof(QColor));
    arg << flags << audioFile << reminder << repeatType << repeatCount << repeatInterval;

scheduleFile

#### scheduleFile

schedule a new alarm which displays the contents of a text or image file.

    bool scheduleFile(const QString& URL, const QDateTime& dateTime, const QColor& bg, int flags, const QString& audioURL, int reminder, const QString& recurrence)

    bool scheduleFile(const QString& URL, const QDateTime& dateTime, const QColor& bg, int flags, const QString& audioURL, int reminder, int simpleRepeatType, int interval, int repeatCount)

    bool scheduleFile(const QString& URL, const QDateTime& dateTime, const QColor& bg, int flags, const QString& audioURL, int reminder, int simpleRepeatType, int interval, const QDateTime& endTime)

##### Parameters

`URL`

  Specifies the name or &URL; of a text or image file whose contents are to be displayed in the message to be scheduled.

`dateTime`

  Specifies the scheduled date and time at which the file should be displayed.

`bg`

  Specifies the background colour for displaying the file.

`flags`

  Specifies the logical OR of the desired alarm flags. The flag bits are those defined in class KAEvent in `alarmevent.h`

`audioURL`

  Specifies the name or &URL; of an audio file which is to be played when the message is displayed.

`reminder`

  Specifies the number of minutes in advance of the main alarm and of each of its recurrences (if any) at which a reminder alarm should be displayed. Specify 0 if no reminder is required.

`recurrence`

  Specifies a regular recurrence for the alarm, using iCalendar syntax as defined in RFC2445. For example, FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO would specify 4 repetitions at 3-monthly intervals on the last Monday of the month. For a non-recurring alarm, specify an empty string.

`simpleRepeatType`

  Specifies the recurrence type for the alarm. The permissible values are MINUTELY, DAILY, WEEKLY, MONTHLY_DAY, ANNUAL_DATE. These are defined in class KAEvent in `alarmevent.h`.

`interval`

  Specifies the number of periods (minutes/days/weeks/months/years) between repetitions of the alarm.

`repeatCount`

  Specifies the number of times that the file should be displayed. Specify -1 to repeat the alarm indefinitely.

##### Description

`scheduleFile()` is a &DCOP; call to schedule the specified text or image file for display at the specified date and time. Apart from specifying a file name or &URL; and omitting the foreground colour, its usage is identical to `scheduleMessage` - see the description of that function for further details.

scheduleCommand

#### scheduleCommand

schedule a new alarm which executes a shell command.

    bool scheduleCommand(const QString& commandLine, const QDateTime& dateTime, int flags, const QString& recurrence)

    bool scheduleCommand(const QString& commandLine, const QDateTime& dateTime, int flags, int simpleRepeatType, int interval, int repeatCount)

    bool scheduleCommand(const QString& commandLine, const QDateTime& dateTime, int flags, int simpleRepeatType, int interval, const QDateTime& endTime)

##### Parameters

`commandLine`

  Specifies the shell command line whose execution is to be scheduled.

`dateTime`

  Specifies the scheduled date and time at which the command should be executed.

`flags`

  Specifies the logical OR of the desired alarm flags. The flag bits are those defined in class KAEvent in `alarmevent.h` except that the BEEP flag bit is ignored.

`recurrence`

  Specifies a regular recurrence for the alarm, using iCalendar syntax as defined in RFC2445. For example, FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO would specify 4 repetitions at 3-monthly intervals on the last Monday of the month. For a non-recurring alarm, specify an empty string.

`simpleRepeatType`

  Specifies the recurrence type for the alarm. The permissible values are MINUTELY, DAILY, WEEKLY, MONTHLY_DAY, ANNUAL_DATE. These are defined in class KAEvent in `alarmevent.h`.

`interval`

  Specifies the number of periods (minutes/days/weeks/months/years) between repetitions of the alarm.

`repeatCount`

  Specifies the number of times that the alarm should be repeated. Specify -1 to repeat the alarm indefinitely.

##### Description

`scheduleCommand()` is a &DCOP; call to schedule the specified shell command line for execution at the specified date and time. Apart from specifying a command line and omitting the message colour and audio file parameters, its usage is identical to `scheduleMessage` - see the description of that function for further details.

scheduleEmail

#### scheduleEmail

schedule a new alarm which sends an email.

    bool scheduleEmail(const QString& addresses, const QString& subject, const QString& message, const QString& attachments, const QDateTime& dateTime, int flags, const QString& recurrence)

    bool scheduleEmail(const QString& addresses, const QString& subject, const QString& message, const QString& attachments, const QDateTime& dateTime, int flags, int simpleRepeatType, int interval, int repeatCount)

    bool scheduleEmail(const QString& addresses, const QString& subject, const QString& message, const QString& attachments, const QDateTime& dateTime, int flags, int simpleRepeatType, int interval, const QDateTime& endTime)

##### Parameters

`addresses`

  Specifies the recipient's email address. Specify multiple addresses by separating them with commas.

`subject`

  Specifies the subject line of the email.

`message`

  Specifies the email message body.

`attachments`

  Specifies the &URL;s of files to attach to the email. Separate multiple &URL;s by commas.

`dateTime`

  Specifies the scheduled date and time at which the email should be sent.

`flags`

  Specifies the logical OR of the desired alarm flags. The flag bits are those defined in class KAEvent in `alarmevent.h`

`recurrence`

  Specifies a regular recurrence for the alarm, using iCalendar syntax as defined in RFC2445. For example, FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO would specify 4 repetitions at 3-monthly intervals on the last Monday of the month. For a non-recurring alarm, specify an empty string.

`simpleRepeatType`

  Specifies the recurrence type for the alarm. The permissible values are MINUTELY, DAILY, WEEKLY, MONTHLY_DAY, ANNUAL_DATE. These are defined in class KAEvent in `alarmevent.h`.

`interval`

  Specifies the number of periods (minutes/days/weeks/months/years) between repetitions of the alarm.

`repeatCount`

  Specifies the number of times that the email should be sent. Specify -1 to repeat the alarm indefinitely.

##### Description

`scheduleEmail()` is a &DCOP; call to schedule the specified email for sending at the specified date and time. Apart from specifying the email header and contents and omitting the message colour and audio file parameters, its usage is identical to `scheduleMessage` - see the description of that function for further details.

### Command line interface

Command line options are provided to enable other programs (such as the alarm daemon) to start up &kalarm; if it is not already running, in order to trigger or cancel scheduled alarms, or schedule new alarms. The reason for using command line options for this purpose is that if &kalarm; were started without any command line parameters and then sent &DCOP; requests, it would start in its default graphical mode, which is clearly undesirable for an inter-program request.

Programs should first check whether &kalarm; is already running; if it is, they should instead use &DCOP; calls to request these operations.

The command line options for scheduling a new alarm are as described in the chapter Command line operation. The options for triggering and cancelling scheduled alarms are as follows:

Normal users may also if they wish use these command line options (assuming that they can supply the necessary parameter information).

Option | Description
--- | ---
`--calendarURL url` | Use the calendar file with the specified &URL;. This option is only used for integrity checking: if the &URL; doesn't specify &kalarm;'s current default calendar file, the request will be ignored.
`--cancelEvent eventID` | Cancel the event with the specified event ID.
`--triggerEvent eventID` | Trigger the event with the specified event ID. The action taken is the same as for the triggerEvent() &DCOP; call.
`--handleEvent eventID` | Trigger or cancel the event with the specified event ID. &kalarm; determines which action to take in the same way as for the handleEvent() &DCOP; call.

`--cancelEvent`, `--triggerEvent` and `--handleEvent` are mutually exclusive. `--calendarURL` is optional, but can only be used with one of the other three options.

Examples are:

    % kalarm --triggerEvent &kalarm;-387486299.702 --calendarURL file:/home/zaphod/hydra.ics
    % kalarm --cancelEvent &kalarm;-388886299.793

## Questions and Answers

&reporting.bugs; &updating.documentation;

What is the alarm daemon?

The alarm daemon is an application which runs in the background, monitoring alarms and telling &kalarm; to trigger them when they become due.

What configuration files does &kalarm; use?

The file `$KDEHOME/share/config/kalarmrc` holds your &kalarm; preferences.

The calendar file which stores your pending alarms is `$KDEHOME/share/apps/kalarm/calendar.ics`, unless a different calendar file is specified in the preferences file by a `Calendar` entry in the `General` section.

If you change this calendar file in the preferences file, you should also edit the alarm daemon's `clients` configuration file to remove the old calendar file reference. This should be done while the alarm daemon is not running to avoid it overwriting your change.

The calendar file which stores your expired alarms is `$KDEHOME/share/apps/kalarm/expired.ics`, unless a different calendar file is specified in the preferences file.

The calendar file which stores your alarm templates is `$KDEHOME/share/apps/kalarm/template.ics`, unless a different calendar file is specified in the preferences file.

Details of alarms currently being displayed are stored in the calendar file `$KDEHOME/share/apps/kalarm/displaying.ics`.

What configuration files does the alarm daemon use?

The file `$KDEHOME/share/config/kalarmdrc` holds your alarm daemon preferences.

The file `$KDEHOME/share/apps/kalarmd/clients` holds details of client applications which have previously been registered with the alarm daemon, and their calendar files.

What are the application names of &kalarm; and the alarm daemon?

&kalarm;'s application name is kalarm, and the alarm daemon's application name is kalarmd. In addition, in &kde; versions previous to 3.1, there is a small application kalarmautostart whose function is to start &kalarm;'s system tray icon at login.

## Credits and Licence

&kalarm;

Program copyright 2001, 2002, 2003, 2004 David Jarvie software@astrojar.org.uk

Alarm daemon authors:

- Preston Brown pbrown@kde.org

- David Jarvie software@astrojar.org.uk

- Cornelius Schumacher schumacher@kde.org

Documentation copyright 2001, 2002, 2003, 2004 David Jarvie software@astrojar.org.uk

Thanks go to the author of the &kde;1 KAlarm application, Stefan Nikolaus stefan.nikolaus@stuco.uni-oldenburg.de, who kindly agreed to allow the name &kalarm; to be used by this &kde;2/&kde;3 application.

&underFDL;

&underGPL;

## Installation

### How to obtain &kalarm;

&install.intro.documentation;

&kalarm; is available for &kde;2 and as a standalone package for &kde;3 from http://www.astrojar.org.uk/linux/kalarm.html

### Requirements

&kalarm; requires the standard &kde; libraries to be installed (the `kdelibs` package). To compile from source, you also need the &Qt; and `kdelibs` development packages. The X11 development package, if present, is used to improve &kalarm;'s ability to function under &kde; without a system tray.

&kalarm; uses about 12 Mb and the alarm daemon uses about 2.5 Mb of memory to run, but this may vary depending on your platform and configuration.

You can find a list of changes in the `ChangeLog` file, or at http://www.astrojar.org.uk/linux/kalarm.html.

### Compilation and installation

If you cannot obtain a suitable precompiled binary package, you need to compile &kalarm; yourself from source files. Get the source package file `kdepim-x.x.tar.bz2` or `kalarm-x.x.tar.bz2` (or similar), depending on whether you want to install &package; or just &kalarm;. Unpack it in a new folder using a command similar to ``tar` `xvfj package.tar.bz2``, and change to the folder which has been created.

&install.compile.documentation;

If you have more than one version of &kde; installed (e.g. &kde;2 and &kde;3), this may possibly install &kalarm; into the wrong &kde; folder. If necessary, you can give the &kde; folder as a parameter to ``./configure`` . For example, if your &kde; is installed in `/opt/kde2`:

``./configure` --prefix=/opt/kde2`

The standalone version of &kalarm; has a special configuration option which allows you to select which languages documentation is to be installed for by specifying a language code, or a list of language codes, as a parameter to `./configure`. By default, documentation in all available languages is installed. A list of documentation languages included in the package, together with their codes, is in the `DOC-LANGUAGES` file. Note that this has no effect on which user interface translations are installed. For example, to install only French and British English documentation:

``./configure` --enable-doc-language="fr en_GB"`

### Configuration

No special configuration is required to set up &kalarm; to run on the &kde; desktop. Once you have run &kalarm; for the first time, the alarm daemon will start every time you log in, in order to monitor scheduled alarms.

To run &kalarm; on a non-&kde; desktop, the main requirement is to ensure that the alarm daemon is run automatically whenever you log in. More detailed instructions are contained in the `INSTALL` file which is distributed with &kalarm;.

&documentation.index;