Skip to main content

A simple command line program that allows users to set an alarm with a custom command.

Project description

CommandAlarm

CommandAlarm is a simple command line program that allows users to set an alarm with a custom command.

Installation

To install CommandAlarm, you can use pip:

pip install commandalarm

Alternatively, you can clone the repository and install it manually:

git clone https://github.com/alofgren/commandalarm.git
cd commandalarm
pip install .

Usage Output

usage: commandalarm [-h] [-v] [-d {1,2,3,4,5,6,7}] [-r] [-s] [-n] [-t TIMEOUT] time command [argument ...]

Set an alarm with a custom command.

positional arguments:
  time                  the time in the format HH:MM:SS
  command               the command to run
  argument              the arguments to the command

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -d {1,2,3,4,5,6,7}, --day {1,2,3,4,5,6,7}
                        the day of the week as an integer from 1 to 7
  -r, --repeat          repeat forever
  -s, --shell           run command in a shell
  -n, --no-check        don't check the command return code
  -t TIMEOUT, --timeout TIMEOUT
                        timeout in seconds for the command to complete

Examples

To set an alarm for 2:00 PM and play a sound when the alarm goes off:

commandalarm 14:00:00 aplay alarm_sound.wav

To set an alarm for 9:15 AM on Wednesday to run a Python script with a timeout of 30 seconds:

commandalarm 09:15:00 --day 3 --timeout 30 python3 script.py

To run a command in a shell, use the -s or --shell option:

commandalarm 16:00:00 --shell 'ENV_VAR="I am running in a shell"; echo $ENV_VAR'

To disable further option processing, use two hyphens ("--") before the command:

commandalarm 16:00:00 -- ls -l

Contributing

If you would like to contribute to CommandAlarm, please feel free to submit a pull request or open an issue on the GitHub repository.

License

CommandAlarm is licensed under the GPL License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CommandAlarm-0.2.8.tar.gz (19.0 kB view hashes)

Uploaded Source

Built Distribution

CommandAlarm-0.2.8-py3-none-any.whl (18.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page