Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bbelderbos/cli_alarm
A simple CLI alarm clock
https://github.com/bbelderbos/cli_alarm
Last synced: about 1 month ago
JSON representation
A simple CLI alarm clock
- Host: GitHub
- URL: https://github.com/bbelderbos/cli_alarm
- Owner: bbelderbos
- License: mit
- Created: 2024-06-16T14:25:01.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-03T11:58:57.000Z (5 months ago)
- Last Synced: 2024-10-09T17:32:47.021Z (about 1 month ago)
- Language: Rust
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CLI Alarm
This is a simple CLI alarm utility that plays a sound when the time is reached. Ideal to remind yourself to get up from the computer and stretch for example. You can run it once or repeatedly.
## Installation
```bash
cargo install cli-alarm
```
## Usage```bash
A simple CLI alarm saying a message after a certain amount of time.Usage: alarm [OPTIONS] --message <--seconds |--minutes >
Options:
-s, --seconds Number of seconds to wait before playing the alarm
-m, --minutes Number of minutes to wait before playing the alarm
-r, --repeat Repeat the alarm
-M, --message Message to speak instead of playing an audio file [default: "You set an alarm, time is up!"]
-t, --times Times to play the alarm sound [default: 3]
-h, --help Print help
-V, --version Print version
```## Run in background
To run it permanently in the background I added this to my .zhrc file:
```bash
function run_alarm_if_not_running {
if ! pgrep -f "alarm -m 60 -M" > /dev/null; then
alarm -m 60 -M "go walk" -t 2 -r &
fi
}
run_alarm_if_not_running
```When opening a new terminal it checks if the alarm is running, if not it starts it.
This particular invocation will say "go walk" two times every hour, a good reminder to get up and stretch!