This is a quick and simple alarm clock, in Rust, that can be configured from a text file.
The aim of this project was to give Rust a try:
- Use cargo for bin and lib
- Use external crates (time, audio)
- Have a better understanding of ownership
- String manipulation
- Read keyboard inputs
- Read from file system
- Use threads
- Communicate between threads using channels
- Documentation
- Testing in file and in an external module
Create a text file <project_root>/rustine_config/config
The format is CSV-like.
For an alarm running from monday to friday at 6:30 am an audio file at 75% of max volume:
MTWTF__;06:30:00;/some/file/system/path/audio.ogg;75
# You may add other configurations, one per line
Audio files are read with rodio
that support WAV, Vorbis, Flac.
Get Cargo
.
- Use
cargo run
to start the application. - Use
cargo test
to run the tests. - Use
cargo doc --no-deps
to generate the docs.
Once running:
help
to show the supported commandsshow
to show the alarm configurationstop
to stop a running alarmquit
to stop the whole application
See LICENSE file