pillbox

package module
v0.0.0-...-91edf21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 9 Imported by: 0

README

💊 Pillbox

Go Report Card

What is this?

This is a CLI app written in Golang, that can be used to set medications reminders. I hope you never use it, but if you are sick and you are taking meds, this might help you remember when to take your meds. At least it helped me.

❗️ Important ❗️

Currently this works only on OSX, since it heavily relies on launchd for management of the daemon. When I get the OSX support clean and shiny I will take a look at GNU/Linux and Windows.

Installation

go get github.com/fteem/pbox

That should do it.

Usage

Pillbox is a package that allows you to set reminders for your medications. It doesn't allow setting exact consumption times per medication, but it splits all medication in three consumption times: morning (10:00h), afternoon (16:00h) and evening (20:00h).

The notifications are in fact OSX notifications, shown using notify. They look like this:

alert

Installation

To install the pillboxd daemon, you need to run:

pillbox install

This will create a new launchd agent for your user, which will manage the state of the daemon. The Property List (.plist) file will be located at ~/Library/LaunchAgent/com.ieftimov.pillbox.plist.

There's no need to load the agent since the command will take care of that. Post-install you should receive a notification that the daemon is started.

To check if the agent is running, run:

pillbox status
Uninstallation

To completely remove the daemon you can run:

pillbox uninstall

That's it, no more reminders!

Reminders management

To list all reminders, use:

pillbox reminders list

This will print out a table containing all of the active reminders:

+-------------+---------+-----------+---------+
| Name        | Morning | Afternoon | Evening |
+-------------+---------+-----------+---------+
| Probiotics  | Yes     | No        | No      |
| Antibiotics | Yes     | Yes       | Yes     |
| Brufen      | No      | No        | Yes     |
+-------------+---------+-----------+---------+

To add a new reminder, use:

pillbox reminders add Antibiotics [--morning] [--afternoon] [--evening]

This will set a reminder for Antibiotics, but it will require any of the three flags to be set. If any of the flags are not present, it will fail with:

pillbox: error: Any (or all) of the --morning, --afternoon or --evening flags have to be present.

To remove a reminder, use:

pillbox reminders remove Antibiotics

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/fteem/pbox. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The code is available as open source under the terms of the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(c *launchd.Config) error

func Load

func Load(c *launchd.Config) error

func Uninstall

func Uninstall(c *launchd.Config) error

func Unload

func Unload(c *launchd.Config) error

Types

type Checkpoint

type Checkpoint struct {
	Hour   int
	Minute int
}

func (Checkpoint) Equal

func (c Checkpoint) Equal(t time.Time) bool

type Reminder

type Reminder struct {
	ID        int    `json:"id"`
	Body      string `json:"body"`
	Morning   bool   `json:"morning"`
	Afternoon bool   `json:"afternoon"`
	Evening   bool   `json:"evening"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(path string) *Store

func (*Store) Close

func (s *Store) Close() error

func (*Store) DeleteReminder

func (s *Store) DeleteReminder(reminder Reminder) error

func (*Store) FetchReminders

func (s *Store) FetchReminders() ([]Reminder, error)

func (*Store) Open

func (s *Store) Open() error

func (*Store) SaveReminder

func (s *Store) SaveReminder(reminder Reminder) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL