Chapter 4. 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:

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:

OptionDescription
-a, --ack-confirmPrompt for confirmation when the alarm message is acknowledged.
-A, --attach URLSpecify the name or URL of a file which is to be attached to the email. This option may be repeated as necessary. --mail must be specified with this option.
-b, --beepMake an audible beep when the message is displayed. --play and --play-repeat cannot be specified with this option.
--bccBlind copy the email to yourself. --mail must be specified with this option.
-c, --color, --colour colorSet the message background color to the specified Qt™ color name or hex code 0xRRGGBB.
-C, --colorfg, --colourfg colorSet the message foreground color to the specified Qt™ color name or hex code 0xRRGGBB.
-e, --exec commandlineSpecify a shell command to execute. If specified, this option must be the last KAlarm option in KAlarm's command line. All subsequent command parameters and options are interpreted as forming the command line to execute. --file and --mail cannot be specified with this option. --ack-confirm, --beep, --color and --colorfg are ignored with this option.
-f, --file URLSpecify the name or URL of a text or image file whose contents are to form the alarm message. --exec and --mail cannot be specified, and message must not be present with this option.
-i, --interval periodSet the interval between repetitions of the alarm. Hours/minutes are specified in the format nHnM, where n is a number, e.g. 3H30M. Other time periods are specified in the format nX, where n is a number and X is one of the following letters: Y (years), M (months), W (weeks), D (days). Mandatory if --repeat or --until is specified. --recurrence cannot be specified with this option.
-l, --late-cancelCancel the alarm if it cannot be triggered at the correct time.
-L, --loginTrigger the alarm every time you log in. --interval, --repeat and --until cannot be specified with this option.
-m, --mail addressSend an email to the specified address. This option may be repeated as necessary. --exec and --file cannot be specified with this option. --ack-confirm, --beep, --color and --colorfg are ignored with this option.
-p, --play URLSpecify the name or URL of an audio file to be played once when the alarm message is displayed. --play-repeat and --beep cannot be specified with this option.
-P, --play-repeat URLSpecify the name or URL of an audio file to be played repeatedly for as long as the alarm message is displayed. --play and --beep cannot be specified with this option.
--recurrence specSet the alarm to recur. Specify the recurrence using iCalendar syntax (defined in RFC2445), e.g.“FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO”. --repeat, --interval, and --until cannot be specified with this option.
-r, --repeat countSet the number of times the alarm should be triggered. Specify -1 to repeat the alarm indefinitely. --interval must be, and --until and --recurrence cannot be, specified with this option.
-R, --reminder periodOutput a reminder alarm the specified length of time before the main alarm and each of its recurrences (if any). Hours/minutes are specified in the format nHnM, where n is a number, e.g. 3H30M. Other time periods are specified in the format nX, where n is a number and X is one of the following letters: W (weeks), D (days). This option cannot be specified with --exec or --mail.
-S, --subject subjectThe subject line of the email. --mail must be specified with this option.
-t, --time date/timeTrigger alarm on the date or at the date/time specified. Specify a date without a time in the format yyyy-mm-dd; specify a date and time by [[[yyyy-]mm-]dd-]hh:mm (where omitted, date fields default to the values for today).
-v, --volume percentageSet the audio volume for playing the audio file. This option can only be used when --play or --play-repeat is specified.
-u, --until date/timeRepeat the alarm until the date or date/time specified. Specify a date without a time in the same format as for --time. --interval must be, and --repeat and --recurrence cannot be, specified with this option.
messageMessage text to display or, if --mail is specified, the body of the email message.

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

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

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