cli reminder

Version, currently master branch1 version
  • master branchlatestJun 16, 2021

github.com/evait-security/reminder

No description declared in shard.yml.

5 stars
0 dependents
License: not declared

Installation

# Add this to your shard.yml
dependencies:
  cli reminder:
    github: evait-security/reminder
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
Target
  • reminder from reminder.cr

Dependencies

Runtime Dependencies

  • db*github: crystal-lang/crystal-db
  • sqlite3*github: crystal-lang/crystal-sqlite3

README

cli reminder

Uses the notify-send command in combination with a sqlite database and systemd-timers in order to create text based reminders.

Example usage

reminder add -m "go to bed 1h" # reminds you in one hour with the message "go to bed"
reminder add -m "10m call bob back" # reminds you in 10 minutes to re-call bob
reminder show # show all upcoming reminders
reminder run # execute all overdue reminders (should be used with systemd-timers or cron)

bash / zsh alias

You can create a small alias for your favorite shell. Edit your .bashrc or .zshrc and add the following function:

rme () {
  reminder add -m "$*"
}

Now reminders can be added with a minimum of parameter usage, e.g.:

rme 10m make a break # reminds you in 10 minutes to take a break

creating a systemd timer (user)

In order to receive notifications you have to create a service / cronjob that executes reminders run method at least once every minute.

User services are located in the ~/.config/systemd/user/ directory.

Create a file in this directory called reminder.service with the following content and replace [USERNAME] with your username:

[Unit]
Description=reminder

[Service]
Type=oneshot
ExecStart=/usr/local/sbin/reminder run
WorkingDirectory=/home/[USERNAME]

After that a timer is needed. Simply create the file reminder.timer in the same directory with the following content:

[Unit]
Description=reminder

[Timer]
OnCalendar=*:0/1
Persistent=true

[Install]
WantedBy=timers.target

In order to enable the timer simply run the following command:

systemctl --user enable reminder.timer && systemctl --user start reminder.timer

creating a crontab (user)

Coming soon, PR welcome.

running the developer tests

crystal spec

building from source

Clone the repository and run:

shards install
shards build --production --release --no-debug

The executable will then be located in ./bin/reminder