# The &kalarm; Handbook

## Introduction

&kalarm; lets you schedule the display of personal alarm messages, the playing of sound files, the execution of commands and the sending of emails.

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 configuring an alarm, you can choose whether it should repeat, and whether the alarm should be canceled if it cannot be triggered at its scheduled time. For display alarms, you can type in a message text, specify a text or image file to display, or specify a command whose output should be displayed. You can also choose the color of the alarm message, and whether to play a sound or speak the message.

Alarms may also be scheduled from the command line, or via &DBus; 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; usually shows an icon in the system tray, although this can be hidden if desired.

## Using &kalarm;

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

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 Types

The basic functions available from the different alarm types which &kalarm; provides are:

- Display alarms display either a text message which you type in, or the contents of a text or image file, or the textual output from a command which is run when the alarm triggers. In addition to displaying one of these items, they can also play audio files, have their text spoken, or emit a simple beep. You can also specify commands to be executed before and after the alarm message is displayed.

- Command alarms execute either a command or a shell script which you can type in. Nothing is displayed unless an error occurs.

- Email alarms send a email. Nothing is displayed unless an error occurs.

- Audio alarms play an audio file. Nothing is displayed unless an error occurs.

#### Error Handling

If an error occurs when an alarm triggers, an error message will be displayed (unless you have previously specified not to show that type of message again).

If an execution error occurred the last time a command alarm triggered, a white on red exclamation mark is shown in the message color column. Details of the error are displayed in a tooltip if you position the cursor over that line in the alarm list. The same error indications are shown for display alarms if an execution error occurred for a pre- or post-alarm command specified in the Special Actions dialog, except that the color column is not changed to a red background.

### Alarm List

The main &kalarm; window displays the current list of pending alarms, showing their times, repetition intervals, colors, and message texts, names of files to play or display, commands to execute or email subjects. (For a recurring alarm, the time shown is its next scheduled trigger time. For an alarm with a reminder, the time shown is the time of the alarm proper, not the reminder 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 (⪚ 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).

If an execution error occurred the last time a command alarm triggered, or the last time a display alarm's pre- or post-alarm command was executed, an error indication is shown in the color column, as described in Error Handling above.

#### Changing the Alarm List Appearance

The alarms may be ordered by date/time, repeat interval, color, type 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.

If you use multiple alarm calendars, you can color code alarms according to which calendar they belong to, by selecting a different background color for each calendar (see Using Calendars).

#### Archived Alarms

By default, &kalarm; archives alarms for a limited period once they have expired or been deleted. (But note that alarms which you delete are stored only if they have already triggered at least once.) You can control whether &kalarm; archives expired alarms, and for how long, in the Configuration dialog.

Archived alarms may be shown in the alarm list by selecting View Show Archived Alarms. To hide them again, deselect View Show Archived Alarms.

#### Searching the Alarm List

You can search through the alarm list to find alarms containing a search text. To invoke this, select Edit Find.... In the search dialog, select the alarm types which you wish to search. To continue searching for more alarms which match, use Edit Find Next or Edit Find Previous .

Searching is performed as follows:

- Text message alarms: the message text is searched.

- File display alarms: the file path/&URL; is searched.

- Command alarms: the command line or command script is searched.

- Email alarms: in addition to the subject and body of the email, the recipients and the URLs of attachments are searched.

- Audio alarms: the file path/&URL; is searched.

Only alarms currently shown in the alarm list can be selected for searching. So if you want to search archived alarms, you must first display them as described in the section above.

### Creating and Manipulating Alarms

#### Creating a New Alarm

To create a new alarm, do one of the following, and then select the type of alarm from the list which appears. This displays the Alarm Edit dialog through which you configure the alarm.

- Select File New.

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

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

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

- To base your new alarm on an alarm template, follow the instructions in the Alarm Templates section.

- To base your new alarm on an existing one, highlight the existing alarm in the list and select File Copy. This opens the Alarm Edit dialog 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. Then select the Display Alarm option. This opens the Alarm Edit dialog with the entire email message (including sender, recipient, &etc;) as the alarm text.

- To create a new email alarm to send a copy of an existing email message, drag the email from &kmail; onto &kalarm;'s main window or system tray icon. Then select the Email Alarm option. The Alarm Edit dialog is preset with the entire email message except sender.

- To create a new alarm which displays a summary of an existing to-do, drag the to-do from &korganizer; or other application onto &kalarm;'s main window or system tray icon. This opens the Alarm Edit dialog with the to-do contents as the alarm text.

- To create a new command alarm, drag the text of a script starting with #! onto &kalarm;'s main window or system tray icon. Then select the Command Alarm option. This opens the Alarm Edit dialog preset with the script text.

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

- To create an audio alarm, drag an audio file &URL; onto &kalarm;'s main window or system tray icon. This opens the Alarm Edit dialog and sets the file name.

- To create a text message alarm, drag any piece of text onto &kalarm;'s main window or system tray icon. If prompted, select the Display Alarm option. This opens the Alarm Edit dialog preset with the alarm text.

- 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 Edit Edit.

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

This displays the Alarm Edit dialog.

#### Deleting/Reactivating an Alarm

To delete existing alarms, select one or more by clicking on their entries in the alarm list. Then do one of the following:

- Choose Edit Delete .

- Right click on the selected entries and choose Delete from the context menu.

- To delete them without a confirmation prompt, type &Shift;-Delete.

When you delete an active alarm, it is archived, provided that it has triggered at least once before being deleted, and provided that expired alarms are archived at all. (Use the Configuration dialog to control whether and for how long archived alarms are stored.) When you delete an archived alarm, or an active alarm which has not yet triggered, it is removed permanently.

You can reactivate a deleted alarm from the archived alarms list, provided that it has not yet expired. To do this, first display archived alarms, as described in Archived Alarms. Then:

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

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

#### Enabling/Disabling an Alarm

See Enabling and Disabling Alarms for how to enable and disable alarms, either individually or as a whole.

#### Setting an Alarm to Wake from Suspend

See Wake From Suspend for how to configure an alarm to wake up your system from suspension or hibernation.

#### 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 program 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 open the Alarm Edit dialog with that template and then enter the time and date.

To create an alarm based on a template, open the Alarm Edit dialog preset with the template details:

- Select the File New New Alarm From Template menu item, and then select the desired template.

- Right click on the system tray icon and choose New Alarm New Alarm From Template from the context menu. Then select the desired template.

- Open the Alarm Edit dialog in the usual way, and click the Load Template... button to select a template to preset the dialog with.

##### Configuring Templates

You can create, modify or delete templates using the Alarm Templates dialog, 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 dialog by selecting the File Templates... menu item, clicking New, and choosing the alarm type from the list which appears. This displays a blank Template Edit dialog.

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

- Highlight an alarm in the alarm list and select File Create Template... . This opens the Template Edit dialog already filled in with a copy of the selected alarm's details.

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

To delete existing templates, display the Alarm Templates dialog 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 Dialog

The Template Edit dialog is similar to the Alarm Edit dialog. 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.

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

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

  - Check Time from now to enter how long (in hours and minutes) after the alarm is created, that it should be triggered.

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

#### Alarm Calendars

If you only use one computer and work independently, it may not matter to you where &kalarm; stores its alarms. But if you need to access alarms on more than one computer, or in more than one location on your local computer, you can define alarm calendars to tell &kalarm; to use other alarm calendars additional to, or in place of, its default ones.

You can view and manipulate calendars via the calendar list, which can be displayed alongside the alarm list in &kalarm;'s main window. Alarms from all alarm calendars are shown merged together in the alarm list. When you save a new alarm, you can set a configuration option to determine whether it is automatically saved into the default calendar, or whether you will be prompted to choose a calendar. When you edit an existing alarm, it is automatically saved back into its original alarm calendar.

Screenshot of the &kalarm; main window, showing the calendar list Main window showing the calendar list

##### Calendar Types and Options

Alarm calendars are categorized by alarm type and storage type. They can be disabled, set read-only, or made the default calendar for their alarm type.

Alarm type

- The three alarm entity types – active alarms, archived alarms and alarm templates – are stored in separate alarm calendars. &kalarm; therefore has three standard default calendars, one for each type (see Questions and Answers for details), which you can change if you wish.

Storage type

- &kalarm; handles three alarm calendar storage types:

  - Local file: Alarms are stored in a single local file in iCalendar format. &kalarm; uses local file calendars by default (see Questions and Answers for details). Local files, in addition to files on the local computer, can include alarm calendars on the local network as long as their location can be represented by a path name starting with `/`.

  - Local directory: Alarms are stored in a local folder, each alarm being stored in a separate iCalendar file within the folder. This storage method has the advantage that in the event of file corruption, you should lose only one alarm, not the entire calendar.

  - Remote file: Alarms are stored in a single remote file in iCalendar format. This storage method allows you to access your alarm data remotely no matter where you are, or enables alarm calendars to be viewed by other people. When using remote files, &kalarm; works with a local cache of the data.

    If a remote alarm calendar is shared between users, changes made by one person may not be automatically made available to another user, or there could be a time delay before the other user sees it. So one user could make a change which is then overwritten by another user without either person noticing what has happened. The technical reason for this is that a change made by person A will only be available to person B after person A's cached copy has first been saved to the remote file, and then person B's cached copy of the remote file has been reloaded. When and if the calendar is saved and reloaded depends on the calendar configuration parameters which each user has set for that alarm calendar.

    Ways to avoid this problem include adjusting the calendar save and reload configuration parameters, or adopting a policy that users other than the alarm calendar's owner should open it in read-only mode.

Enabled/disabled status

- Disabling a calendar has the same effect as removing it, except that it still appears in the calendar list for easy re-enabling. When disabled, its alarms are ignored and do not appear in the alarm list or list of templates. When it is re-enabled, its alarms are once again shown and, if it is an active alarm calendar, made active.

Read-only status

- A read-only calendar's alarms cannot be changed or added to. So you cannot edit its alarms, or save new alarms to it. Also, it is not possible to defer its alarms, since to do so would need the deferral time to be saved into the alarm. After its alarms trigger, they are not removed from the calendar and archived until you or another user accesses the calendar in read-write mode.

  You can set the read-only status of a calendar in the calendar configuration dialog. However, some calendars cannot be made writeable, for various reasons:

  - If a calendar was created by another application, it would be unsafe to allow &kalarm; to update it, since differences in data format might make it unusable by the creating application.

  - If the calendar was created by a later version of &kalarm;, data might be lost if your version of &kalarm; updated it.

  - If the calendar was created by a previous version of &kalarm;, data could be lost or it could be made unusable for the previous &kalarm; version if your version of &kalarm; updated it. You will be prompted whether to convert its format so as to make it writeable, bearing in mind the potential compatibility problems if the previous &kalarm; version needs to access it again.

  - If you do not have permission to write to the calendar file or folder.

  If you need write access to alarms in a calendar which cannot be made writeable, you can copy its alarms by importing them into a writeable calendar using the latter calendar's Import... context menu option (see Importing Alarms from External Calendars).

Default calendar status

- One calendar of each alarm type can optionally be made the default calendar for that alarm type. New alarms are automatically saved to the default calendar for the appropriate alarm type, unless you have selected the prompt option for new alarms and templates in the Configuration dialog.

##### Using Calendars

You can view and manipulate calendars via the calendar list, which can be displayed or hidden by View Show Calendars . When using the calendar list, first select the alarm type using the combo box above the list. Then either click on one of the buttons below the list, or Right click on the appropriate calendar in the list and choose an item from the context menu. The actions available are:

Add...

- Add a calendar of the selected type to the list. You are asked to choose a storage type, following which the calendar configuration dialog is displayed, where you can enter the location of the calendar and its characteristics. If there is no existing alarm calendar in the specified location, a new one will be created.

Remove

- Remove the selected calendar from the list. The calendar itself is left intact; it is simply removed from the list, and may subsequently be reinstated in the list if desired.

Edit...

- Edit the selected calendar. This displays the configuration dialog for the selected calendar.

Reload

- Reload the selected calendar. The calendar is re-read from its storage location, ensuring that there is no discrepancy between what &kalarm; displays and the current state of the calendar. If the calendar is shared with other users, any changes which they have made will now be seen by &kalarm;.

  If you reload a remote calendar, any changes to alarms which you have made since the calendar was last saved will be lost. Also, any alarms which have expired since the last save may be retriggered.

Save

- Save any changes to the selected calendar. The calendar is updated with any alarm changes which have occurred since the last time the calendar was saved or reloaded. This is only useful for remote calendars, since local calendars are automatically saved after every change. You can configure when and how frequently a remote calendar should be automatically saved, using its configuration dialog (via the Edit... context menu option).

  If you save a remote calendar which is shared with other users, any changes which they have made since you last reloaded the calendar (automatically or manually) will be lost.

Import...

- Import alarms from an external calendar file into the selected calendar. This is described in Importing Alarms from External Calendars. This option is not available for disabled or read-only calendars.

Export...

- Export all the alarms in the selected calendar to an external calendar file. This is described in Exporting Alarms to External Calendars. This option is not available for disabled calendars.

Show Details

- Display details about the selected calendar. This shows the calendar's location, storage type and status information.

Use as Default

- Make the selected calendar the default calendar for the selected calendar type. This option is not available for disabled or read-only calendars.

Set Color...

- Select a background color for highlighting this calendar's alarms in the alarm list. This enables you to see at a glance which alarms belong to a particular calendar.

Clear Color

- Clear color highlighting for this calendar's alarms in the alarm list.

#### Importing Alarms from External Calendars

You can import alarms from other calendar files into &kalarm;. The import function scans the selected calendar file for events containing alarms, and copies them (with new unique IDs) into &kalarm;'s calendar. Events without alarms, and calendar entries other than events, are ignored. There are two ways to import alarms:

- Use File Import Alarms... to import alarms of all types (active alarms, archived alarms and alarm templates) from the calendar.

  If you have configured alarm calendars, alarms of each type will be added to the appropriate default calendar, or if you have selected the prompt option for new alarms and templates in the Configuration dialog, you will be prompted for the calendar to use.

- Right click on a calendar in the calendar list, and choose Import... from the context menu. This imports alarms of the currently selected type into that calendar. For example, if the selected calendar type is alarm templates, alarm templates (and not active alarms or archived alarms) will be imported.

If you import alarms from calendar files which were created by applications other than &kalarm;, the alarms may be changed by the import process – even alarm times may change. This depends on the data storage conventions used by the other application, and is unavoidable if those conventions differ from what &kalarm; expects. Always check imported alarms for unexpected changes, and adjust them as necessary.

#### Exporting Alarms to External Calendars

You can export alarms from &kalarm; to other calendar files, either the alarms currently selected in the alarm list, or all the alarms from an alarm calendar. The methods to do this are given below. Whichever method is used, you can either create a new calendar file or append the exported alarms to an existing calendar file. To append the alarms, check Append to existing file in the file selection dialog; otherwise, any existing file is overwritten.

- To export the alarms currently selected in the alarm list, Right click on the selection and choose Export... from the context menu, or use File Export Selected Alarms... in the main menu.

- To export all the alarms from a calendar, Right click on a calendar in the calendar list, and choose Export... from the context menu.

#### Importing Birthdays from &kaddressbook;

You can set up display alarms for birthdays stored in &kaddressbook;, by File Import Birthdays.... This displays a dialog 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 the format currently defined in the Alarm Text group box.

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

If you have configured alarm calendars, the alarms will be added to the default active alarm calendar, or if you have selected the prompt option for new alarms and templates in the Configuration dialog, you will be prompted for the calendar to use.

#### Undo / Redo

You can undo and redo the most recent changes which you have made during the current session of &kalarm;. Most actions can be undone, including creation, edit and deletion of alarms and alarm templates, and reactivation of alarms. To prevent excessive resources being used by the undo history, the number of changes stored is limited to the last 12.

To undo the last change, select Edit Undo. To redo the last change which was undone, select Edit Redo .

To undo a change other than the last one, click on the Undo button in the toolbar and hold the mouse button down. A list of actions will be displayed from which you can choose the one to undo. If you don't see the action which you are looking for, remember that you may need to undo more recent changes first, which the desired change depends on. For example, if you edited an alarm and then deleted it, you cannot undo the edit until you have first undone the deletion.

Redoing a change other than the last one can be done in a similar manner, using the Redo toolbar button.

### The Alarm Edit Dialog

The Alarm Edit dialog enables you to view and edit an alarm. When you first use &kalarm;, a simplified form of the dialog is displayed, with only a small number of options visible. To see all options, click the More Options button; to revert to the simplified dialog, click the Less Options button. &kalarm; always remembers your last display choice whenever the Alarm Edit dialog is redisplayed.

You can configure the default values of many of the settings in the Alarm Edit dialog using the Configuration dialog's Edit tab.

Screenshot of the simplified Alarm Edit dialog Simplified Alarm Edit dialog for a display alarm

Simplified Alarm Edit dialog for a display alarm

Screenshot of the Alarm Edit dialog showing all options Alarm Edit dialog for a display alarm, showing all options

Alarm Edit dialog for a display alarm, showing all options

#### Alarm Action

The controls in the Action group box vary depending on the type of alarm being edited.

##### Display Alarms

Display alarms display a window when the alarm triggers. Select the method used to generate the alarm window contents, using the combo box at the top:

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

- File contents to enter the path 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 dialog. The Speak option is not available for this type of alarm.

- Command output to specify that the alarm message text will be generated by a command which is executed when the alarm triggers. See Command Alarms below for details of how to enter the command or command script to execute.

The controls available for display alarms are:

- The Sound option allows you to select whether an audible alarm should sound when the alarm message is displayed. Choose:

  - None to display the alarm silently.

  - Beep to sound a beep.

  - Speak to have the alarm message spoken as well as being displayed. This option is only available if you have &jovie; (from the kdeaccessibility package) installed and configured, together with a compatible speech synthesizer, ⪚ Festival.

  - Sound file to play an audio file. Use the button on the right to display the Sound File dialog which lets you select a file to play and set volume and repetition options. If you hover the mouse over the selector, a tooltip will display the audio file currently selected.

    In the Sound File dialog:

    - Enter the sound file path, or use the button beside the edit box to display a file selection dialog. You can listen to the selected file by clicking the play button to the left of the edit field. That button then changes function to allow you to stop playing when you have heard enough.

    - Check 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.)

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

    - If you wish, you can fade the volume. Fading means to start playing the audio file at one volume and gradually change to the final volume, over a specified time interval. The final volume is that entered in Volume above. To enable fade, check Fade, and then enter the fade period in seconds in the Fade time field, and adjust the Initial volume slider.

    You can use the Try button to test out the selected sound levels.

- Use the Font & Color... button to select a font, and foreground and background colors, for the alarm message. In the Choose Alarm Font & Color dialog, check Use default font to display the message in whatever font is configured as the default at the time the message is displayed. To choose a specific font for the message, uncheck Use default font. (The default font and colors can be set in the Configuration dialog.)

  The selected colors are shown in the alarm message text entry field.

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

  - 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.

    A pre-alarm action is only executed once when the alarm message is initially displayed, including when a reminder message is replaced by the actual alarm message. It is not executed in any of the following circumstances:

    - When a reminder message is displayed.

    - When the message is redisplayed after deferring the alarm, unless Execute for deferred alarms is checked.

    - When the message was displaying at the time you logged off and is then restored when you log back in.

    - When a recurring alarm triggers but the alarm message (or a deferred alarm message) from a previous occurrence of the alarm is still visible; in other words, when the previous occurrence of the alarm has not yet been acknowledged.

    The pre-alarm action can be used to control whether to display the alarm message:

    - Check Cancel alarm on error to cancel the alarm if the pre-alarm command returns an error status. This will prevent the alarm message from being displayed, and any post-alarm action from being executed.

    - Normally, if the pre-alarm command returns an error, an error message is displayed and an error indication is shown in the alarm list. These error notifications can be prevented by checking Do not notify errors.

  - In the Post-alarm action field, enter a shell command to execute when the alarm is acknowledged (whether by clicking Close or by using the close button in the window's titlebar). It is not executed in any of the following circumstances:

    - When a reminder message is closed.

    - When you defer the alarm, except when the deferred alarm is finally acknowledged.

    - When the alarm message is closed due to logging out.

  See Command Alarms below for details of how shell commands are executed.

##### Command Alarms

Command alarms execute a command without displaying any alarm message.

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

When the command is executed, the environment variable `KALARM_UID` contains the event UID for the alarm. Note that when the command is executed from the Alarm Edit dialog's Try button, `KALARM_UID` will be blank if it is a new alarm, or if the alarm has been modified in the dialog, because the alarm only acquires a UID when it is saved in the alarm calendar.

The controls available for command alarms are:

- The Enter a script check box lets you choose whether to enter a shell command line or a script.

  If this option is unchecked, you can 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.

  If this option is checked, you can enter the text of a script to execute. Remember to include a first line such as `#!/bin/bash` to ensure that the correct command interpreter is invoked.

- Use the Command Output group box to specify what you want to be done with any terminal output which the command produces when it executes.

  - Check Execute in terminal window to cause the command to be executed in a terminal window. You can choose which type of terminal window should be used in the Configuration dialog.

  - Check Log to file to save the command's output in a file. The output, prefixed by a heading showing the time at which the command was scheduled to run, will be appended to any existing contents of the file. Enter the file name in the edit box, or use the button beside the edit box to display a file selection dialog.

  - Check Discard to throw away the command's output.

##### Email Alarms

Email alarms send an email without displaying any alarm message.

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.

Set the following options:

- The From combo box allows you to select which &kmail; identity to use as your email address for sending the email. This option only appears if your From email address in the Configuration dialog is set to Use &kmail; identities. Otherwise your email address is preset in the Configuration dialog, rendering this option inapplicable.

- Check 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 Configuration dialog, the default being your email address set in the &kde; System Settings.

##### Audio Alarms

Audio alarms play an audio file without displaying any alarm message.

Set the following options:

- Enter the sound file path, or use the button beside the edit box to display a file selection dialog.

- Check Repeat to continually repeat the audio file until the Stop Play option is selected. To stop playing the file, select the Actions Stop Play menu option, or Right click on the system tray icon and choose Stop Play from the context menu. If you wish, you can set up a global shortcut key for this action.

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

- If you wish, you can fade the volume. Fading means to start playing the audio file at one volume and gradually change to the final volume, over a specified time interval. The final volume is that entered in Volume above. To enable fade, check Fade, and then enter the fade period in seconds in the Fade time field, and adjust the Initial volume slider.

#### 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 dialog 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. Check 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.

If desired, choose a time zone to apply to the alarm. This time zone is used for all dates and times relating to this alarm, including recurrence and exception dates and times. Normally, you should leave the time zone controls unchanged unless you have a good reason to change them.

The time zone controls are displayed only when the selected time zone is different from the default time zone set in the Configuration dialog, or if you click the Time Zone... button.

- In the combo box, choose the time zone which this alarm is to use. When creating a new alarm, this is initially set to the time zone selected in the Configuration dialog, which will be your computer's time zone unless you have changed it.

- Check Ignore time zone if you want to use the local computer time (on whichever computer &kalarm; happens to be running on at the time), ignoring time zones.

  You are recommended not to select this option if the alarm has a recurrence specified in hours and minutes; if you do, the alarm may occur at unexpected times after daylight saving time shifts.

#### Reminder

For a display alarm, check Reminder if you want to display a reminder either before or after the main alarm and each of its recurrences (if any). Enter how long in advance or afterwards, using the edit controls beside the check box. Note that if the alarm recurs, the reminder period is normally limited to being less than the recurrence or sub-repetition interval.

Reminders are not displayed for sub-repetitions within a recurrence. Reminders are only shown for each main recurrence of the alarm.

If the alarm recurs, check Reminder for first recurrence only if you only want a reminder for the alarm's first recurrence. If this is checked, and it is an advance reminder, the reminder period is not subject to the normal limit of being less than the recurrence or sub-repetition interval.

#### Cancelation

The late-cancelation options determine how an alarm is treated after its scheduled time:

- The Cancel if late check box determines what happens if the alarm cannot be triggered at its scheduled time.

  Check this box to cancel the alarm if it cannot be triggered within a specified time period after the right time. The time period is selected using controls which appear when you check the box. For example, if you enter a time period of 1 hour, the alarm will be triggered at the first opportunity up to an hour after it is due, but if it cannot be triggered within an hour its activation will be canceled.

  The lateness of date-only alarms, &ie; ones for which the Any time option is selected, is calculated from the start-of-day time on the alarm's scheduled date.

  Leave the box unchecked to trigger the alarm at the first opportunity starting at the scheduled time, regardless of how late it is.

  An alarm can only be triggered while you are logged in, and while both X and &kalarm; are running.

- Check Auto-close window after this time if you want the alarm window to be automatically closed if it is still showing at the expiry of the late-cancelation time.

#### Recurrence

Specify whether or how the alarm should be repeated using the Recurrence tab.

The alarm's basic repetition characteristics are displayed for convenience in the title of the Recurrence tab. The recurrence interval is shown first, followed by any sub-repetition interval set up using the Sub-Repetition button.

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 restart &kalarm;.)

- 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, check 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 (⪚ the second Tuesday).

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

    If you set up a yearly recurrence for February 29th, you can specify how it is to be handled in non-leap years by selecting the appropriate February 29th alarm in non-leap years option:

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

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

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

  To set a daily alarm to occur only on weekdays, use a weekly recurrence and check 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. Note that this uses the same time zone as the alarm's start time.

  The end date/time determines when the last main recurrence will be, but does not limit sub-repetitions. If sub-repetitions are configured, they will trigger as normal after the last main recurrence, regardless of the end date/time.

The Exceptions group box allows you to exclude certain date/times from the recurrence which you have set up. Note that these controls are not shown in the simplified form of the Alarm Edit dialog: to see them, click More Options.

- 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.

- You can restrict an alarm not to occur on holidays by checking Exclude holidays. This does not change the way the alarm is scheduled; it simply suppresses the alarm whenever it happens to trigger on a holiday. You can select your holiday country or region in the Configuration dialog.

- You can restrict an alarm to occur only during working time by checking Only during working hours. This does not change the way the alarm is scheduled; it simply suppresses the alarm whenever it happens to trigger outside working hours. Work days and working hours are set in the Configuration dialog.

##### Sub-Repetition

You can use the Sub-Repetition button to set up a repetition within a repetition. In this case, each time the alarm is due as specified in the main recurrence, instead of being triggered just once it is triggered repeatedly in accordance with your sub-repetition specification. For example, to set up an alarm which repeats every hour from noon to 6 pm each Thursday, you would set up a weekly recurrence on Thursday at 12:00, and use the Sub-Repetition dialog to specify an interval of 1 hour and either a count of 6 or a duration of 6 hours.

In the Sub-Repetition dialog which is displayed when you click the Sub-Repetition button, check Repeat every to set up a repetition, or uncheck it to remove the repetition. If Repeat every is checked, set up the repetition as follows:

- Enter the time interval between repetitions in the controls beside Repeat every. Select the desired time units (⪚ days) and then enter the number of units.

- Specify either the repetition count or its duration:

  - Select Number of times to enter how many times the alarm should be triggered after the main recurrence. So, for example, to make the alarm occur 4 times at each main recurrence, &ie; 3 additional times, you should enter 3 here.

  - Select Duration to enter the total time period during which the alarm should be repeated. This need not be an exact multiple of the repetition interval; it will automatically be rounded down when you click OK.

To prevent overlapping sub-repetitions for the same alarm, a sub-repetition's duration is restricted to be less than the longest interval between main recurrences. Each time the alarm recurs as specified in the main recurrence, any still active sub-repetition which started at the previous recurrence is automatically cancelled.

#### Other Controls

For display alarms, the Confirm acknowledgment check box 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 acknowledgment of alarms.

Select Show in &korganizer; to add the alarm to &korganizer;'s active calendar, where it will appear as an event without an alarm. This option allows you to track alarms in &korganizer; while still making use of &kalarm;'s functions.

If you later modify or delete the alarm in &kalarm;, the &korganizer; event will be modified or deleted correspondingly. But if you change the event in &korganizer;, the alarm in &kalarm; will not be affected.

Press the Load Template button to select a template to preset the dialog 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. In the case of an audio alarm, press the Try button a second time to stop playing the sound file.

Press the OK button when all details are correct, to add the alarm to the scheduled list. Note that when editing an existing alarm, the OK button is disabled while no changes have been made.

### 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. If the alarm's scheduled time is in a different time zone from your local computer's setting, its time zone will also be displayed. (For reminder messages, the date/time shown is that for the main alarm or its recurrence, not the reminder message time, and the window title is Reminder.)

Alarm message windows remain visible until you acknowledge them, unless Auto-close window after late-cancelation time was checked in the Alarm Edit dialog. 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 whichever of the following options are applicable to the displayed alarm:

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

- Edit the alarm by clicking the Edit... button. This displays the Alarm Edit dialog.

- 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 OK to defer the alarm message and close its window.

  The time the alarm is deferred to must be earlier than its next scheduled occurrence or next advance reminder. For this reason, the Defer... button in the alarm message window and the OK button in the Deferral dialog are disabled one minute before the next occurrence or advance reminder.

  Note that if a reminder is configured after the alarm, you can defer the alarm past its reminder time. In this case, the reminder will be suppressed.

  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.

- If the alarm message was created by dragging an email from &kmail;, you can directly access the email in &kmail; by clicking the button showing the &kmail; icon. This will select and highlight the email in &kmail;'s folder list.

  If &kmail;'s indexes are regenerated, the link to the email in &kmail; will be lost.

- The button showing the &kalarm; icon provides a convenient way to activate &kalarm;.

You can choose in the Configuration dialog which of two different modes should be used to display alarm message windows:

- 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 or frame, so you cannot move it or resize it.

When an alarm is displayed on top of a full screen application, it is shown as a non-modal window regardless of this configuration setting. This is due to a limitation of the window system.

#### Positioning of Message Windows

You can choose in the Configuration dialog which of two schemes should be used to position alarm message windows:

- The windows are displayed as far away from the current mouse cursor as possible. This minimizes disruption to your work flow and minimizes the possibility of accidentally acknowledging the alarm.

- The windows are displayed in the center of the screen. To reduce the chance of accidentally acknowledging the alarm, the buttons on the window are initially disabled, becoming active only after a configurable delay.

If you have several alarm message windows, or error messages, displayed, you can spread the windows out across the screen to make them all visible, or group them all together again in the top left corner of the screen, by means of the View Spread Windows menu option. If you wish, you can set up a global shortcut key for this action.

### System Tray Operation

&kalarm; by default displays an icon in the system tray. The icon provides both control and an alarm monitoring status indication. A normal &kalarm; icon indicates that alarms are being monitored, while a gray icon indicates that alarms are not being monitored. If some individual alarms are disabled, a small cross is overlaid on the icon.

&kalarm;'s system tray icon is by default automatically hidden whenever there are no alarms due in the next 24 hours. You can change the auto-hide time limit, or always show the system tray icon, using the Configuration dialog. To show the icon when it has been automatically hidden, click the arrow in the system tray to reveal hidden icons.

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 Configuration dialog.

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 or disables monitoring of alarms.

  See Enabling and Disabling Alarms for details.

New Alarm

- After you select the alarm type from the list which appears, opens the Alarm Edit dialog to create a new alarm.

Stop Play

- Halts playback of the audio file currently playing.

Spread Windows

- Spreads alarm and error message windows across the screen, or groups them together again.

Configure &kalarm;...

- Displays the &kalarm; Configuration dialog.

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

Restore / Minimize

- Restores or minimizes the main &kalarm; window.

Quit

- Closes the &kalarm; system tray icon and main windows.

  Quits &kalarm; if no alarm message windows are displayed.

#### Displaying &kalarm; in the System Tray

You must be running the &kde; desktop or another suitable window manager in order to display &kalarm; in the system tray.

Select View Show in System Tray to display &kalarm; in the system tray according to the preferences set in the View tab of the Configuration dialog.

To remove &kalarm; from the system tray, deselect View Show in System Tray.

To choose whether or not &kalarm; will be shown at startup in the system tray, use the View tab of the Configuration dialog.

### 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 . This causes &kalarm; to reload all alarm calendars.

You can reload an individual calendar and refresh its alarms in the alarm list by Right clicking the calendar in the calendars list and selecting the Reload menu option. See Alarm Calendars for details.

### Enabling and Disabling Alarms

Alarms may be enabled and disabled either as a whole or individually:

- Alarm monitoring applies to alarms as a whole. While alarm monitoring is disabled, no alarms are triggered at all. While alarm monitoring is enabled (the normal situation), all alarms which are not individually disabled will trigger at the appropriate times.

  When alarm monitoring is re-enabled, alarms which would have triggered while it was disabled are now triggered (unless any late-cancel option prevents this). In other words, disabling alarm monitoring has the same effect as stopping &kalarm; – alarms are postponed until it is re-enabled.

- Alarms may be individually enabled and disabled, independently of the alarm monitoring status. So the enabled/disabled status of individual alarms will be unchanged by disabling and then re-enabling alarm monitoring. Unlike alarm monitoring which could potentially be disabled due to &kalarm; not running, individual alarms can only be disabled if you use menu commands to do so.

  When an alarm is individually re-enabled, it is not now triggered if it became due while disabled. In other words, disabling an individual alarm cancels all its occurrences until it is re-enabled.

  An alarm's individual enabled/disabled status is indicated by its color in the alarm list (the color being configurable in the View tab of the Configuration dialog).

For an alarm to trigger, it must be individually enabled as well as alarm monitoring being enabled.

#### Enabling Alarm Monitoring

For alarm monitoring to occur, &kalarm; must be running. Once you run &kalarm;, it will from then on start automatically whenever you log in unless you later disable it in the General tab of the Configuration dialog.

If alarm monitoring is currently disabled, do one of the following to enable alarms:

- Select Actions Enable Alarms.

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

#### Disabling Alarm Monitoring

You can temporarily disable alarm monitoring, which prevents &kalarm; from checking any alarms either until you re-enable alarms, or – assuming that &kalarm; is configured to start at login – until the next time you log in.

- Unselect Actions Enable Alarms.

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

- Run &kalarm; with the command line option `--disable-all`.

- Stop &kalarm; as described in Quitting &kalarm;.

Alarms may be permanently disabled by preventing &kalarm; from being started at login using the General tab of the Configuration dialog.

#### Enabling and Disabling Individual Alarms

To enable individual alarms which are currently disabled, do one of the following:

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

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

To disable individual alarms which are currently enabled, do one of the following:

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

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

### Wake From Suspend

It is possible to configure a selected alarm to wake your computer from hibernation or suspension when the alarm triggers, so that the alarm action can occur even when the system was shut down. This function is controlled by a dialog which is accessed by selecting Actions Wake From Suspend. The dialog allows the Wake From Suspend alarm to be set, cancelled or displayed.

Use of the Wake From Suspend function requires administrative privileges. You will be prompted for the root password when you set or cancel a Wake From Suspend alarm.

Wake From Suspend is not supported on some computers, especially older ones, and some computers only support setting a wakeup time up to 24 hours ahead. There may also be restrictions on which suspend mode the function will wake from. You should consider setting up test alarms to check your system's capability before relying on this feature.

Your computer can only schedule a single Wake From Suspend at a time. If you use this function with &kalarm;, you must ensure that this does not conflict with any other application which also uses Wake From Suspend. Whenever an application schedules or clears Wake From Suspend, this cancels any previously set Wake From Suspend, no matter whether set by &kalarm; or any other application.

The Wake From Suspend dialog is used in conjunction with the alarm list in &kalarm;'s main window.

- Use highlighted alarm: this sets the alarm currently highlighted in the alarm list as the Wake From Suspend alarm. Any existing scheduled Wake From Suspend is cancelled, as explained above. The button is enabled only if exactly one alarm is highlighted.

- Cancel wake from suspend: this cancels any existing Wake From Suspend (whether set by &kalarm; or any other application - see above). Note that this only cancels the wakeup function associated with the alarm; the alarm itself is not deleted and will continue to operate as normal.

- Show current alarm: this highlights the current Wake From Suspend alarm in the alarm list, so that it can be identified. The button is disabled if no Wake From Suspend is currently configured.

- The Number of minutes before alarm to wake from suspend control allows you, if you wish, to ensure that the system has time to fully restore itself before the alarm triggers, so that the alarm can trigger at the correct time.

### Quitting &kalarm;

Quit &kalarm; by selecting File Quit, or Quit in the system tray icon context menu. Alternatively, if the system tray icon is not visible, close all &kalarm;'s windows.

## Configuring &kalarm;

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

### General

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

- Start at login: &kalarm; will be started automatically at &kde; session login, ensuring that &kalarm; runs at all times unless you manually quit.

  This option should always be checked unless you intend to discontinue use of &kalarm;.

  This option is automatically reselected whenever &kalarm; is run. So if you have unchecked this option and want to continue to prevent &kalarm; from running at login, you need to uncheck this option again each time you run &kalarm;.

- 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.

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

- Default defer time interval: Enter the default time interval, in hours and minutes, to show initially when the Defer Alarm dialog is displayed. Note that if an alarm has been deferred previously, the interval shown initially in the Defer Alarm dialog will be equal to the deferral interval used the last time that alarm was deferred.

- Terminal for Command Alarms: Here, you can select which type of terminal window should be used for command alarms which are executed in a terminal window. Some of the most common terminal window applications are preconfigured, ⪚ xterm, &konsole;, although only those which are installed on your system will be shown here. You can view the actual command options used for each application by displaying the context help for its radio button.

  If you want to use another application, or want to use one of those listed but with different command options, select Other and enter the command to invoke the terminal window. By default, the alarm's command string will be appended to what you specify. Alternatively, you may specify where the alarm's command string should be inserted, by use of the following codes:

  %c

- The alarm's command string will be substituted.

%w

- The alarm's command string will be substituted, with a `sleep` appended.

%C

- A temporary command file containing the alarm's command string will be created, and the command to execute the file will be substituted.

%W

- A temporary command file containing the alarm's command string will be created with a `sleep` appended, and the command to execute the file will be substituted.

When the command alarm is triggered, its command string will be quoted before being inserted into the terminal window command.

### Time and Date

The Time and Date section lets you set options relating to time and date:

- Time zone: Select your time zone. &kalarm; uses this time zone throughout, except when you override it for individual alarms.

- Holiday region: Select which country's or region's holidays to use. This affects recurring alarms for which the option to exclude holidays is selected.

- 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.

- Working Hours group box: These options let you define your working hours, needed when the Only during working hours option is selected for a recurrence in the Alarm Edit dialog.

  - Check each day which is a working day.

  - Daily start time: enter the time at which you start work each day.

  - Daily end time: enter the time at which you finish work each day.

- KOrganizer event duration: Enter the event duration to set in &korganizer; for alarms which are copied to &korganizer;. The default duration is zero.

### Storage

The Storage section lets you choose options for saving and archiving alarms:

- New Alarms & Templates: Specify which calendar to store new alarms and alarm templates in when using multiple alarm calendars:

  - Store in default calendar: New alarms and alarm templates are automatically added to the default alarm calendar without prompting for confirmation.

  - Prompt for which calendar to store in: When you create a new alarm or alarm template and there is more than one writeable alarm calendar, you will be prompted to choose which calendar to save it in. Note that when alarms are saved on expiry, they are always stored in the default archived alarm calendar without prompting.

- Archived Alarms group box: These options control the storage of archived alarms in the default archived alarm calendar.

  - Keep alarms after expiry: Select this option to archive expired and deleted alarms. Deselect it to keep no record of alarms once they cease to be active. Note that deleted alarms are only archived if they have previously been triggered. If you delete an alarm before it ever triggers, it is discarded.

  - Discard archived alarms after: Set the number of days to store expired and deleted alarms in the archive, after which they are permanently deleted.

  - Clear archived alarms: This button discards all currently archived alarms from the default archived alarm calendar. (Other archived alarm calendars are left unchanged in case they are shared with other people.) This has no effect on alarms which subsequently expire or are deleted; they will continue to be archived 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; (which is started first if necessary) as follows:

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

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

  - 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.

- Copy sent emails into &kmail;'s sent-items folder: Select this option if, every time an email alarm is triggered, you want a copy of the transmitted email to be stored in &kmail;'s `sent-items` folder.

  This option is not available when &kmail; is selected as the email client, since &kmail; automatically does this.

- 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.

- Select your email address to be used as the sender's address in email alarms:

  - Select From to enter an email address.

  - Select Use address from System Settings to use the email address which is configured in the &kde; System Settings.

  - Select Use &kmail; identities to be able to choose at the time you configure an email alarm which of &kmail;'s email identities to use. &kmail;'s default identity will be used for alarms which were already configured before you selected this option.

- Select your email address to be used for sending blind copies of email alarms to yourself when the Copy email to self option is selected:

  - Select Bcc to enter an email address. 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 System Settings to use the email address which is configured in the &kde; System Settings.

### View

The View section lets you control some aspects of &kalarm;'s appearance. In the General tab:

- Show in system tray group box: When selected, the system tray icon is displayed while &kalarm; is running, subject to the selected option:

  - Always show: The system tray icon is always displayed.

  - Automatically hide if no active alarms: The system tray icon is hidden if there are no active alarms.

  - Automatically hide if no alarm due within time period: The system tray icon is hidden if no alarm is due within the entered time period, starting from now.

  When the system tray icon is automatically hidden, you can make it visible by means of the system tray option to show hidden icons.

  When Show in system tray is selected, closing the system tray icon closes all &kalarm; main windows, and if no message windows are visible, quits the application.

- 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.

- The Alarm List group box allows the selection of the colors used in the alarm list in &kalarm;'s main window, to show disabled and archived alarms.

The Alarm Windows tab contains options to control the appearance of alarm message windows.

- Position windows far from mouse cursor: Select this option to display alarm message windows as far away from the current mouse cursor position as possible. This minimizes the chance of accidentally acknowledging an alarm by unintentionally clicking on a button just as the message window appears.

- Center windows, delay activating window buttons: Select this option to display alarm message windows in the center of the screen. To reduce the chance of accidentally acknowledging the alarm, the window's buttons are initially disabled. The delay in seconds before they become active is set in Button activation delay (seconds).

- Message windows have a titlebar 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.

### Edit

The Edit section lets you choose default values for the options in the Alarm Edit dialog:

- The General tab contains options which apply to all alarm types.

  - Set the default states for the Show in KOrganizer and Cancel if late check boxes.

  - Set the default recurrence type.

  - Select the default handling in non-leap years of yearly recurrences scheduled for February 29th.

- The Alarm Types tab contains options which apply to specific types of alarm.

  - For display alarms:

    - Set the default states for the Auto-close window after this time and Confirm acknowledgment check boxes.

    - Set the default reminder period units.

    - Set the default special display alarm actions.

    - Set the default sound options. Note that a default sound file may be specified even if the sound type is not set to Sound file.

  - For command alarms:

    - Set the default states for the Enter a script and Execute in terminal window check boxes.

  - For email alarms:

    - Set the default state for the Copy email to self check box.

- The Font & Color tab lets you set the default appearance of alarm messages. Select their default font, and foreground and background colors.

## 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 &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 path 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.
`--auto-close` | Automatically close the alarm window after the expiry of the `--late-cancel` period. `--late-cancel` must be specified with this option.
`-b`, `--beep` | Make an audible beep when the message is displayed. `--speak`, `--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 `color`` | Set the message background color to the specified &Qt; color name or hex code 0xRRGGBB.
`-C`, `--colorfg`, `--colourfg `color`` | Set the message foreground color to the specified &Qt; color name or hex code 0xRRGGBB.
`-d`, `--disable` | Disable the alarm. It will not trigger until it has been manually enabled.
`--disable-all` | Disable alarm monitoring. This prevents any alarms from being triggered until you re-enable alarms or restart &kalarm;, ⪚ at next login. `--triggerEvent` cannot be specified with this option.
`-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 `--exec-display` and `--mail` cannot be specified with this option. `--ack-confirm`, `--beep`, `--color` and `--colorfg` are ignored with this option.
`-E`, `--exec-display `commandline`` | Specify a shell command to execute to generate the alarm message text. 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. `--exec`, `--file` and `--mail` cannot be specified with this option.
`-f`, `--file `URL`` | Specify the path or &URL; of a text or image file whose contents are to form the alarm message. `--exec`, `--exec-display` and `--mail` cannot be specified, and `message` must not be present with this option.
`-F`, `--from-id `ID`` | Use the specified &kmail; identity as the sender of the email. `--mail` must be specified 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, ⪚ 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). If `--recurrence` is also specified, Y (years) and M (months) are not allowed. Mandatory if `--repeat` or `--until` is specified.
`-k`, `--korganizer` | Show the alarm as an event in &korganizer;'s active calendar.
`-l`, `--late-cancel `period`` | Cancel the alarm if it cannot be triggered within the specified `period` after the correct time. Hours/minutes are specified in the format `nHnM`, where `n` is a number, ⪚ 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). The default value of `period` is 1 minute.
`-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`, `--exec-display` and `--file` cannot be specified with this option. `--ack-confirm`, `--beep`, `--color` and `--colorfg` are ignored with this option.
`-p`, `--play `URL`` | Specify the path or &URL; of an audio file to be played once, either as an audio alarm or when the alarm message is displayed. `--play-repeat`, `--beep` and `--speak` cannot be specified with this option.
`-P`, `--play-repeat `URL`` | Specify the path or &URL; of an audio file to be played repeatedly, either until Stop Play is used, or for as long as the alarm message is displayed. `--play`, `--beep` and `--speak` cannot be specified with this option.
`--recurrence `spec`` | Set the alarm to recur. Specify the recurrence using iCalendar syntax (defined in RFC2445), ⪚ FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO. `--until` cannot be specified with this option.
`-r`, `--repeat `count`` | Set the number of times the alarm should be triggered, or if a recurrence is specified with `--recurrence`, the number of times the alarm should be triggered each time `--recurrence` activates it (&ie; a repetition within a recurrence). If `--recurrence` is not present, specify -1 to repeat the alarm indefinitely. `--interval` must be, and `--until` cannot be, specified with this option.
`-R`, `--reminder `period`` | Output a reminder alarm the specified length of time before or after the main alarm and each of its recurrences (if any). The `period` is specified in the same format as described for `--late-cancel`. By default, the reminder will occur before the alarm. To specify a reminder after the alarm, prefix `period` with `+`, ⪚ +3D. This option cannot be specified with `--exec`, `--mail` or `--reminder-once`.
`--reminder-once `period`` | Output a reminder alarm once, the specified length of time before or after the first recurrence of the alarm. No reminder will be displayed before or after subsequent recurrences (if any). The `period` is specified in the same format as described for `--reminder`. This option cannot be specified with `--exec`, `--mail` or `--reminder`.
`-s`, `--speak` | Speak the message when it is displayed. This option requires &jovie; to be installed and configured, together with a compatible speech synthesizer. `--beep`, `--play` and `--play-repeat` cannot be specified with this option.
`-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 [TZ]`; specify a date and time by `[[[yyyy-]mm-]dd-]hh:mm [TZ]` (where omitted, date fields default to the values for today). If no time zone is specified, the local system time zone is assumed. If a time zone specifier `TZ` is present, it may be the name of a system time zone (⪚ `Europe/London`), `UTC` representing the UTC time zone, or `Clock` to use the local computer clock and ignore time zones.
`-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 the date or date/time using the same syntax as for `--time`. Note that if `--time` is specified, the time zone will be taken from its value and no time zone may be included in the `--until` value. `--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`, `--exec`, `--exec-display`, `--play` or `--play-repeat` 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 perform various functions, including displaying the Alarm Edit dialog.

Option | Description
`--edit `eventID`` | Display the Alarm Edit dialog to edit the alarm with the specified event ID.
`--edit-new-audio` | Display the Alarm Edit dialog, in order to edit a new audio alarm.
`--edit-new-command` | Display the Alarm Edit dialog, in order to edit a new command alarm.
`--edit-new-display` | Display the Alarm Edit dialog, in order to edit a new display alarm.
`--edit-new-email` | Display the Alarm Edit dialog, in order to edit a new email alarm.
`--edit-new-preset `templateName`` | Display the Alarm Edit dialog, preset with the alarm template of the specified name, in order to edit a new alarm.
`--list` | Output a list of scheduled alarms to `stdout`. The list shows brief details of each pending alarm: its resource identifier (if using Akonadi), UID, next scheduled time and message text or file.
`--tray` | Display &kalarm; as an icon in the system tray.
`--disable-all` | Disable monitoring of all alarms.

### 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 license information.

## Developer's Guide to &kalarm;

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

- schedule a new alarm

- cancel an already scheduled alarm

- trigger an already scheduled alarm

- display the Alarm Edit dialog

- list scheduled alarms

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

### &DBus; Interface

The &DBus; calls described in this document are all implemented in &kalarm;'s `/kalarm` &DBus; object path. The interface is defined in the files `org.kde.kalarm.kalarm.xml` and `kalarmiface.h`.

cancelEvent

cancelEvent

cancel an already scheduled alarm.

    void cancelEvent(const QString& eventID)

##### Parameters

`eventID`

- Specifies the unique ID of the event to be canceled.

##### Description

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

triggerEvent

triggerEvent

trigger an already scheduled alarm.

    void triggerEvent(const QString& eventID)

##### Parameters

`eventID`

- Specifies the unique ID of the event to be triggered.

##### Description

`triggerEvent()` is a &DBus; 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 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. If the alarm is not due yet, its scheduled occurrences are left unchanged.

scheduleMessage

scheduleMessage

schedule a new alarm message.

    bool scheduleMessage(const QString& message,
                         const QString& startDateTime,
                         int lateCancel,
                         unsigned flags,
                         const QString& bgColor,
                         const QString& fgColor,
                         const QString& font,
                         const QString& audioURL,
                         int reminderMins,
                         const QString& recurrence,
                         int subRepeatInterval,
                         int subRepeatCount)

    bool scheduleMessage(const QString& message,
                         const QString& startDateTime,
                         int lateCancel,
                         unsigned flags,
                         const QString& bgColor,
                         const QString& fgColor,
                         const QString& font,
                         const QString& audioURL,
                         int reminderMins,
                         int recurType,
                         int recurInterval,
                         int recurCount)

    bool scheduleMessage(const QString& message,
                         const QString& startDateTime,
                         int lateCancel,
                         unsigned flags,
                         const QString& bgColor,
                         const QString& fgColor,
                         const QString& font,
                         const QString& audioURL,
                         int reminderMins,
                         int recurType,
                         int recurInterval,
                         const QString& endDateTime)

##### Parameters

`message`

- Specifies the text of the message to be scheduled, or if `flags` has the `DISPLAY_COMMAND` bit set, specifies the command line to execute to generate the message text.

`startDateTime`

- Specifies the scheduled date, or date and time, at which the message should be displayed. For a date-only alarm, the string should be in the format `YYYY-MM-DD [TZ]` (as returned by `QDate::toString(Qt::ISODate)`). For an alarm with a date and time, the string should be in the format `YYYY-MM-DDTHH:MM[:SS] [TZ]` (as returned by `QDateTime::toString(Qt::ISODate)`) or `HH:MM[:SS] [Clock]` (as returned by `QTime::toString(Qt::ISODate)`). If no date is specified, today's date is used. Note that any seconds value is ignored.

  If no time zone is specified, the local system time zone is assumed. If a time zone specifier `TZ` is present, it may be the name of a system time zone (⪚ `Europe/London`), `UTC` representing the UTC time zone, or `Clock` to use the local computer clock and ignore time zones.

`lateCancel`

- Causes the alarm to be canceled if it cannot be triggered within the specified number of minutes after the alarm's scheduled time. If the value is 0, the alarm will not be canceled no matter how late it is triggered.

`flags`

- Specifies the logical OR of the desired alarm flags. The flag bits are those defined in class `KAlarmIface` in `kalarmiface.h`. Note that not all flag bits are applicable to message alarms.

`bgColor`

- Specifies the background color for displaying the message. The string may be in the format #RRGGBB (as returned by `QColor::name()`) where RR, GG and BB are two-digit hexadecimal values for red, green and blue. Alternatively the string may be in any of the other formats accepted by `QColor::setNamedColor()`, such as a name from the X color database (⪚ red or steelblue). Set the string to null to specify the current default background color.

`fgColor`

- Specifies the foreground color for displaying the message. The format of the string is the same as for `bgColor`, or alternatively set the string to null to specify the current default foreground color.

`font`

- Specifies the font for displaying the message. The format of the string is that output by `QFont::toString()`. Set the string to null to use the default message font current at the time the message is displayed.

`audioURL`

- Specifies the audio file which is to be played when the message is displayed. Set the value to null if no audio file is to be played.

`reminderMins`

- 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 a negative value for a reminder to be displayed after the main alarm. 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.

`recurType`

- Specifies the recurrence type for the alarm. The permissible values are MINUTELY, DAILY, WEEKLY, MONTHLY, YEARLY. These are defined in class `KAlarmIface` in `kalarmiface.h`. Monthly recurrences are of the day of the month type, and yearly recurrences are of the date in the year type, with the date in both cases taken from the `startDateTime` parameter.

`recurInterval`

- Specifies the number of periods (minutes/days/weeks/months/years as specified by `recurType`) between recurrences of the alarm.

`recurCount`

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

`endDateTime`

- Specifies the end date, or date and time, for recurrences of the alarm. If `startDateTime` includes a time, this parameter must also include a time; if `startDateTime` contains only a date, this parameter must also contain only a date. It must not contain a time zone specifier; the same time zone as for `startDateTime` is used to interpret this parameter's value.

`subRepeatInterval`

- Specifies the number of minutes between sub-repetitions of the alarm. Specify 0 for no sub-repetition. Ignored if no recurrence is specified.

`subRepeatCount`

- Specifies the number of sub-repetitions of the alarm, including the initial occurrence.

##### Description

`scheduleMessage()` is a &DBus; call to schedule the specified alarm message for display at the specified date and time. It has three forms. The most general form allows an arbitrary recurrence to be specified – use this also for non-repeating alarms. 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.

If the scheduled time (including any repetitions) has already passed, &kalarm; immediately displays the message (unless the `lateCancel` value indicates that it is now too late to display the alarm, in which case &kalarm; ignores the request). If the scheduled time (or a repetition) is in the future, &kalarm; adds the alarm message to the default active alarm calendar for later display.

scheduleFile

scheduleFile

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

    bool scheduleFile(const QString& URL,
                      const QString& startDateTime,
                      int lateCancel,
                      unsigned flags,
                      const QString& bgColor,
                      const QString& audioURL,
                      int reminderMins,
                      const QString& recurrence,
                      int subRepeatInterval,
                      int subRepeatCount)

    bool scheduleFile(const QString& URL,
                      const QString& startDateTime,
                      int lateCancel,
                      unsigned flags,
                      const QString& bgColor,
                      const QString& audioURL,
                      int reminderMins,
                      int recurType,
                      int recurInterval,
                      int recurCount)

    bool scheduleFile(const QString& URL,
                      const QString& startDateTime,
                      int lateCancel,
                      unsigned flags,
                      const QString& bgColor,
                      const QString& audioURL,
                      int reminderMins,
                      int recurType,
                      int recurInterval,
                      const QString& endDateTime)

##### Parameters

`URL`

- Specifies the text or image file whose contents are to be displayed in the message to be scheduled.

`startDateTime`

- Specifies the scheduled date, or date and time, at which the message should be displayed. For a date-only alarm, the string should be in the format `YYYY-MM-DD [TZ]` (as returned by `QDate::toString(Qt::ISODate)`). For an alarm with a date and time, the string should be in the format `YYYY-MM-DDTHH:MM[:SS] [TZ]` (as returned by `QDateTime::toString(Qt::ISODate)`) or `HH:MM[:SS] [Clock]` (as returned by `QTime::toString(Qt::ISODate)`). If no date is specified, today's date is used. Note that any seconds value is ignored.

  If no time zone is specified, the local system time zone is assumed. If a time zone specifier `TZ` is present, it may be the name of a system time zone (⪚ `Europe/London`), `UTC` representing the UTC time zone, or `Clock` to use the local computer clock and ignore time zones.

`lateCancel`

- Causes the alarm to be canceled if it cannot be triggered within the specified number of minutes after the alarm's scheduled time. If the value is 0, the alarm will not be canceled no matter how late it is triggered.

`flags`

- Specifies the logical OR of the desired alarm flags. The flag bits are those defined in class `KAlarmIface` in `kalarmiface.h`. Note that not all flag bits are applicable to file alarms.

`bgColor`

- Specifies the background color for displaying the file. The string may be in the format #RRGGBB (as returned by `QColor::name()`) where RR, GG and BB are two-digit hexadecimal values for red, green and blue. Alternatively the string may be in any of the other formats accepted by `QColor::setNamedColor()`, such as a name from the X color database (⪚ red or steelblue). Set the string to null to specify the current default background color.

`audioURL`

- Specifies the audio file which is to be played when the message is displayed. Set the value to null if no audio file is to be played.

`reminderMins`

- 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 a negative value for a reminder to be displayed after the main alarm. 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.

`recurType`

- Specifies the recurrence type for the alarm. The permissible values are MINUTELY, DAILY, WEEKLY, MONTHLY, YEARLY. These are defined in class `KAlarmIface` in `kalarmiface.h`. Monthly recurrences are of the day of the month type, and yearly recurrences are of the date in the year type, with the date in both cases taken from the `startDateTime` parameter.

`recurInterval`

- Specifies the number of periods (minutes/days/weeks/months/years as specified by `recurType`) between recurrences of the alarm.

`recurCount`

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

`endDateTime`

- Specifies the end date, or date and time, for recurrences of the alarm. If `startDateTime` includes a time, this parameter must also include a time; if `startDateTime` contains only a date, this parameter must also contain only a date. It must not contain a time zone specifier; the same time zone as for `startDateTime` is used to interpret this parameter's value.

`subRepeatInterval`

- Specifies the number of minutes between sub-repetitions of the alarm. Specify 0 for no sub-repetition. Ignored if no recurrence is specified.

`subRepeatCount`

- Specifies the number of sub-repetitions of the alarm, including the initial occurrence.

##### Description

`scheduleFile()` is a &DBus; call to schedule the specified text or image file for display at the specified date and time. Apart from specifying a file path or &URL; and omitting the foreground color and font, 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 QString& startDateTime,
                         int lateCancel,
                         unsigned flags,
                         const QString& recurrence,
                         int subRepeatInterval,
                         int subRepeatCount)

    bool scheduleCommand(const QString& commandLine,
                         const QString& startDateTime,
                         int lateCancel,
                         unsigned flags,
                         int recurType,
                         int recurInterval,
                         int recurCount)

    bool scheduleCommand(const QString& commandLine,
                         const QString& startDateTime,
                         int lateCancel,
                         unsigned flags,
                         int recurType,
                         int recurInterval,
                         const QString& endDateTime)

##### Parameters

`commandLine`

- Specifies the command whose execution is to be scheduled. The `flags` parameter indicates whether this parameter contains a shell command line or a command script.

`startDateTime`

- Specifies the scheduled date, or date and time, at which the message should be displayed. For a date-only alarm, the string should be in the format `YYYY-MM-DD [TZ]` (as returned by `QDate::toString(Qt::ISODate)`). For an alarm with a date and time, the string should be in the format `YYYY-MM-DDTHH:MM[:SS] [TZ]` (as returned by `QDateTime::toString(Qt::ISODate)`) or `HH:MM[:SS] [Clock]` (as returned by `QTime::toString(Qt::ISODate)`). If no date is specified, today's date is used. Note that any seconds value is ignored.

  If no time zone is specified, the local system time zone is assumed. If a time zone specifier `TZ` is present, it may be the name of a system time zone (⪚ `Europe/London`), `UTC` representing the UTC time zone, or `Clock` to use the local computer clock and ignore time zones.

`lateCancel`

- Causes the alarm to be canceled if it cannot be triggered within the specified number of minutes after the alarm's scheduled time. If the value is 0, the alarm will not be canceled no matter how late it is triggered.

`flags`

- Specifies the logical OR of the desired alarm flags. The flag bits are those defined in class `KAlarmIface` in `kalarmiface.h`. Note that not all flag bits are applicable to command alarms.

`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.

`recurType`

- Specifies the recurrence type for the alarm. The permissible values are MINUTELY, DAILY, WEEKLY, MONTHLY, YEARLY. These are defined in class `KAlarmIface` in `kalarmiface.h`. Monthly recurrences are of the day of the month type, and yearly recurrences are of the date in the year type, with the date in both cases taken from the `startDateTime` parameter.

`recurInterval`

- Specifies the number of periods (minutes/days/weeks/months/years as specified by `recurType`) between recurrences of the alarm.

`recurCount`

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

`endDateTime`

- Specifies the end date, or date and time, for recurrences of the alarm. If `startDateTime` includes a time, this parameter must also include a time; if `startDateTime` contains only a date, this parameter must also contain only a date. It must not contain a time zone specifier; the same time zone as for `startDateTime` is used to interpret this parameter's value.

`subRepeatInterval`

- Specifies the number of minutes between sub-repetitions of the alarm. Specify 0 for no sub-repetition. Ignored if no recurrence is specified.

`subRepeatCount`

- Specifies the number of sub-repetitions of the alarm, including the initial occurrence.

##### Description

`scheduleCommand()` is a &DBus; call to schedule the specified shell command line, or command script, for execution at the specified date and time. Apart from specifying a command and omitting the message color, font 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& fromID,
                       const QString& addresses,
                       const QString& subject,
                       const QString& message,
                       const QString& attachments,
                       const QString& startDateTime,
                       int lateCancel,
                       unsigned flags,
                       const QString& recurrence,
                       int subRepeatInterval,
                       int subRepeatCount)

    bool scheduleEmail(const QString& fromID,
                       const QString& addresses,
                       const QString& subject,
                       const QString& message,
                       const QString& attachments,
                       const QString& startDateTime,
                       int lateCancel,
                       unsigned flags,
                       int recurType,
                       int recurInterval,
                       int recurCount)

    bool scheduleEmail(const QString& fromID,
                       const QString& addresses,
                       const QString& subject,
                       const QString& message,
                       const QString& attachments,
                       const QString& startDateTime,
                       int lateCancel,
                       unsigned flags,
                       int recurType,
                       int recurInterval,
                       const QString& endTime)

##### Parameters

`fromID`

- The &kmail; identity to use as the sender of the email. If empty, the sender's email address will be that configured in &kalarm;'s Email preferences.

`addresses`

- A comma separated list of recipients' email addresses.

`subject`

- Specifies the subject line of the email.

`message`

- Specifies the email message body.

`attachments`

- A comma-separated list of paths or &URL;s of files to send as email attachments.

`startDateTime`

- Specifies the scheduled date, or date and time, at which the message should be displayed. For a date-only alarm, the string should be in the format `YYYY-MM-DD [TZ]` (as returned by `QDate::toString(Qt::ISODate)`). For an alarm with a date and time, the string should be in the format `YYYY-MM-DDTHH:MM[:SS] [TZ]` (as returned by `QDateTime::toString(Qt::ISODate)`) or `HH:MM[:SS] [Clock]` (as returned by `QTime::toString(Qt::ISODate)`). If no date is specified, today's date is used. Note that any seconds value is ignored.

  If no time zone is specified, the local system time zone is assumed. If a time zone specifier `TZ` is present, it may be the name of a system time zone (⪚ `Europe/London`), `UTC` representing the UTC time zone, or `Clock` to use the local computer clock and ignore time zones.

`lateCancel`

- Causes the alarm to be canceled if it cannot be triggered within the specified number of minutes after the alarm's scheduled time. If the value is 0, the alarm will not be canceled no matter how late it is triggered.

`flags`

- Specifies the logical OR of the desired alarm flags. The flag bits are those defined in class `KAlarmIface` in `kalarmiface.h`. Note that not all flag bits are applicable to email alarms.

`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.

`recurType`

- Specifies the recurrence type for the alarm. The permissible values are MINUTELY, DAILY, WEEKLY, MONTHLY, YEARLY. These are defined in class `KAlarmIface` in `kalarmiface.h`. Monthly recurrences are of the day of the month type, and yearly recurrences are of the date in the year type, with the date in both cases taken from the `startDateTime` parameter.

`recurInterval`

- Specifies the number of periods (minutes/days/weeks/months/years as specified by `recurType`) between recurrences of the alarm.

`recurCount`

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

`endDateTime`

- Specifies the end date, or date and time, for recurrences of the alarm. If `startDateTime` includes a time, this parameter must also include a time; if `startDateTime` contains only a date, this parameter must also contain only a date. It must not contain a time zone specifier; the same time zone as for `startDateTime` is used to interpret this parameter's value.

`subRepeatInterval`

- Specifies the number of minutes between sub-repetitions of the alarm. Specify 0 for no sub-repetition. Ignored if no recurrence is specified.

`subRepeatCount`

- Specifies the number of sub-repetitions of the alarm, including the initial occurrence.

##### Description

`scheduleEmail()` is a &DBus; 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 color, font and audio file parameters, its usage is identical to `scheduleMessage` - see the description of that function for further details.

scheduleAudio

scheduleAudio

schedule a new alarm which executes a shell command.

    bool scheduleAudio(const QString& audioURL,
                       int volumePercent,
                       const QString& startDateTime,
                       int lateCancel,
                       unsigned flags,
                       const QString& recurrence,
                       int subRepeatInterval,
                       int subRepeatCount)

    bool scheduleAudio(const QString& audioURL,
                       int volumePercent,
                       const QString& startDateTime,
                       int lateCancel,
                       unsigned flags,
                       int recurType,
                       int recurInterval,
                       int recurCount)

    bool scheduleAudio(const QString& audioURL,
                       int volumePercent,
                       const QString& startDateTime,
                       int lateCancel,
                       unsigned flags,
                       int recurType,
                       int recurInterval,
                       const QString& endDateTime)

##### Parameters

`audioURL`

- Specifies the audio file which is to be played.

`volumePercent`

- Specifies the volume level to use, as a percentage of full volume. Specify -1 to use the default volume.

`startDateTime`

- Specifies the scheduled date, or date and time, at which the message should be displayed. For a date-only alarm, the string should be in the format `YYYY-MM-DD [TZ]` (as returned by `QDate::toString(Qt::ISODate)`). For an alarm with a date and time, the string should be in the format `YYYY-MM-DDTHH:MM[:SS] [TZ]` (as returned by `QDateTime::toString(Qt::ISODate)`) or `HH:MM[:SS] [Clock]` (as returned by `QTime::toString(Qt::ISODate)`). If no date is specified, today's date is used. Note that any seconds value is ignored.

  If no time zone is specified, the local system time zone is assumed. If a time zone specifier `TZ` is present, it may be the name of a system time zone (⪚ `Europe/London`), `UTC` representing the UTC time zone, or `Clock` to use the local computer clock and ignore time zones.

`lateCancel`

- Causes the alarm to be canceled if it cannot be triggered within the specified number of minutes after the alarm's scheduled time. If the value is 0, the alarm will not be canceled no matter how late it is triggered.

`flags`

- Specifies the logical OR of the desired alarm flags. The flag bits are those defined in class `KAlarmIface` in `kalarmiface.h`. Note that not all flag bits are applicable to command alarms.

`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.

`recurType`

- Specifies the recurrence type for the alarm. The permissible values are MINUTELY, DAILY, WEEKLY, MONTHLY, YEARLY. These are defined in class `KAlarmIface` in `kalarmiface.h`. Monthly recurrences are of the day of the month type, and yearly recurrences are of the date in the year type, with the date in both cases taken from the `startDateTime` parameter.

`recurInterval`

- Specifies the number of periods (minutes/days/weeks/months/years as specified by `recurType`) between recurrences of the alarm.

`recurCount`

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

`endDateTime`

- Specifies the end date, or date and time, for recurrences of the alarm. If `startDateTime` includes a time, this parameter must also include a time; if `startDateTime` contains only a date, this parameter must also contain only a date. It must not contain a time zone specifier; the same time zone as for `startDateTime` is used to interpret this parameter's value.

`subRepeatInterval`

- Specifies the number of minutes between sub-repetitions of the alarm. Specify 0 for no sub-repetition. Ignored if no recurrence is specified.

`subRepeatCount`

- Specifies the number of sub-repetitions of the alarm, including the initial occurrence.

##### Description

`scheduleAudio()` is a &DBus; call to schedule the specified audio file to be played at the specified date and time. Apart from specifying a volume and omitting the message color and font parameters, its usage is identical to `scheduleMessage` - see the description of that function for further details.

edit

edit

Display the Alarm Edit dialog to edit an alarm.

    bool edit(const QString& eventID)

##### Parameters

`eventID`

- Specifies the unique ID of the event to be edited.

##### Return value

false if the specified alarm could not be found or is read-only, true otherwise.

##### Description

`edit()` is a &DBus; call to display the Alarm Edit dialog to edit the specified alarm.

editNew

editNew

Display the Alarm Edit dialog to edit a new alarm.

    bool editNew(int type)

    bool editNew(const QString& templateName)

##### Parameters

`type`

- Specifies the alarm type. The permissible values are DISPLAY, COMMAND, EMAIL, AUDIO. These are defined in class `KAlarmIface` in `kalarmiface.h`.

`templateName`

- Specifies the name of an alarm template to base the new alarm on.

##### Return value

false if `type` has an invalid value, or if no template with the name `templateName` can be found; true otherwise.

##### Description

`editNew()` is a &DBus; call to display the Alarm Edit dialog to edit a new alarm. If an alarm type is specified as a parameter, a blank dialog is displayed. Alternatively, if an alarm template name is specified as a parameter, the dialog is preset with details from the template.

list

list

Return a list of scheduled alarms.

    QString list()

##### Return value

List of alarms, separated by newlines, each in the format `resource_id`:`UID` `time` `text` (if using Akonadi), or `UID` `time` `text` (if using KResources).

##### Description

`list()` is a &DBus; call to return a string containing a summary of scheduled alarms. The list shows brief details of each pending alarm: its resource identifier (if using Akonadi), UID, next scheduled time and message text or file.

### Command Line Interface

Command line options are provided to enable other programs 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 &DBus; 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 &DBus; 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 canceling 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
`--cancelEvent `eventID`` | Cancel the alarm with the specified event ID. `--triggerEvent` cannot be specified with this option.
`--triggerEvent `eventID`` | Trigger the alarm with the specified event ID. The action taken is the same as for the triggerEvent() &DBus; call. `--cancelEvent` cannot be specified with this option.

Examples are:

    % kalarm --triggerEvent &kalarm;-387486299.702
    % kalarm --cancelEvent &kalarm;-388886299.793

## Questions and Answers

&reporting.bugs; &updating.documentation;

What configuration files does &kalarm; use?

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

`$KDEHOME/share/config/kresources/alarms/stdrc` holds your alarm calendar configuration.

($`KDEHOME` is usually `˜/.kde` or similar.)

Where does &kalarm; store its alarms?

The names of the calendar files which &kalarm; creates the first time it is run are as follows (but these may be overridden by entries in the `General` section of &kalarm;'s preferences file):

- `$KDEHOME/share/apps/kalarm/calendar.ics` holds active alarms (overridable by the `Calendar` entry).

- `$KDEHOME/share/apps/kalarm/expired.ics` holds archived alarms (overridable by the `ExpiredCalendar` entry).

- `$KDEHOME/share/apps/kalarm/template.ics` holds alarm templates (overridable by the `TemplateCalendar` entry).

You can find out which calendar files are currently in use by viewing each calendar's details in the alarm calendars list. The file names are stored in the alarm calendar configuration file.

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

What format are alarms stored in?

The calendar files in which &kalarm; stores its alarms are text files whose format is defined by the document RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar). This is the standard format used by all kdepim applications. &kalarm; uses certain non-standard properties, in conformance with RFC2445. These are documented in the `DESIGN.html` file which is distributed with &kalarm;.

What is the program kalarmautostart?

kalarmautostart is a little helper program whose function is to autostart &kalarm; at login.

&kalarm; is usually restored by the session manager at login (to redisplay its windows in the same state as they were when you logged off). But if it was not running when you logged off, it would not be started by the session manager and therefore needs to be autostarted. The problem is that when an application is both session managed and autostarted, there is no guarantee as to which will occur first. If autostart gets in first, it will prevent the session manager from restoring the application's state.

To avoid this problem, kalarmautostart is autostarted at login instead of &kalarm;. All it does is wait for a short time (to ensure that the session manager has time to do its job) before starting &kalarm;, at which point it terminates.

## Credits and License

&kalarm;

Program copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 &David.Jarvie; &David.Jarvie.mail;

Documentation copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 &David.Jarvie; &David.Jarvie.mail;

&underFDL; &underGPL;

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 application, which has been available for &kde; 2 onwards.

## Installation

### How to Obtain &kalarm;

&install.intro.documentation;

&kalarm; is also available as a standalone package for &kde; 4, as well as older versions for &kde; 3 and &kde; 2, from http://www.astrojar.org.uk/kalarm

### Requirements

&kalarm; requires the standard &kde; libraries to be installed (the `kdelibs` and `kdepimlibs` packages), plus the `kdebase/runtime` package. To compile from source, you also need the relevant library development packages, and the &Qt; development package.

The following optional packages enhance &kalarm; at runtime if they are installed:

- &jovie; (from kdeaccessibility package): if installed and configured, together with a compatible speech synthesizer package, it allows &kalarm; to speak alarm messages when they are displayed.

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

### 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 install &kalarm; into a folder different from where &kde; is installed, it will not run correctly unless you make its location known to &kde;. To do this, you must prefix the `KDEDIRS` environment variable with &kalarm;'s location, each time before you start &kde;.

For example, if &kde; is installed in `/opt/kde`, `KDEDIRS` might normally be set to `/etc/opt/kde:/opt/kde`. If you install &kalarm; into `/usr/local`, you would need to set `KDEDIRS` to `/usr/local:/etc/opt/kde:/opt/kde` before starting &kde;.

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. For example, to install only French and British English documentation:

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

Note that this option has no effect on which user interface translations are installed.

### 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, it 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 &kalarm; is run automatically whenever you log in. More detailed instructions are contained in the `INSTALL` file which is distributed with &kalarm;.

&documentation.index;