mprevel / rustine

Quick and simple alarm clock that can be configured from a text file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rustine

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:

  1. Use cargo for bin and lib
  2. Use external crates (time, audio)
  3. Have a better understanding of ownership
  4. String manipulation
  5. Read keyboard inputs
  6. Read from file system
  7. Use threads
  8. Communicate between threads using channels
  9. Documentation
  10. Testing in file and in an external module

Configuration

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

Supported format

Audio files are read with rodio that support WAV, Vorbis, Flac.

Running

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 commands
  • show to show the alarm configuration
  • stop to stop a running alarm
  • quit to stop the whole application

License

See LICENSE file

About

Quick and simple alarm clock that can be configured from a text file.

License:MIT License


Languages

Language:Rust 100.0%