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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file CommandAlarm-0.2.8.tar.gz.

File metadata

  • Download URL: CommandAlarm-0.2.8.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for CommandAlarm-0.2.8.tar.gz
Algorithm Hash digest
SHA256 ca57c12e13fcc770036fd79647c0be0c34ae38177a3b0b384301d48d18f0ecd3
MD5 04d6fa62130201877afbe12d6e42e93e
BLAKE2b-256 b1842a2da80657b20670f0ce1539551d25858440adc4f7bec0a166f80d785e56

See more details on using hashes here.

File details

Details for the file CommandAlarm-0.2.8-py3-none-any.whl.

File metadata

File hashes

Hashes for CommandAlarm-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8486edfd7f084cc546f76340991aee9dd23bc90e14142d648024f3d6aaf00461
MD5 33d9425207bb6ecdfba518dd17889ee5
BLAKE2b-256 fadef48c054db0364333d0371245b63b42b254f20f371aa574ec6304d37571a5

See more details on using hashes here.

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