Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/UlyssesZh/peroutine
Fuck the fact that the number of days in a week is prime
https://github.com/UlyssesZh/peroutine
Last synced: about 2 months ago
JSON representation
Fuck the fact that the number of days in a week is prime
- Host: GitHub
- URL: https://github.com/UlyssesZh/peroutine
- Owner: UlyssesZh
- License: mit
- Created: 2022-12-05T19:04:51.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2022-12-07T19:30:34.000Z (over 1 year ago)
- Last Synced: 2024-01-27T16:37:58.125Z (5 months ago)
- Language: Ruby
- Size: 3.91 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- cli-apps - peroutine - Remind you of periodical events. The period can be any positive integer of days, so work around the fact that the number of days in a week is prime. (<a name="organizers"></a>Organizers and calendars)
- awesome-cli-apps - peroutine - Remind you of periodical events. The period can be any positive integer of days, so work around the fact that the number of days in a week is prime. (<a name="organizers"></a>Organizers and calendars)
README
# peroutine
Remind you of periodical events.
The period can be any positive integer of days.
(Work around the fact that the number of days in a week is prime!)## Installation
[Install Ruby](https://www.ruby-lang.org/en/documentation/installation),
and then put the `peroutine` file in a directory in your `$PATH`.
Remember to add execution permission to the file.## Usage
First, run `peroutine edit` to edit the configuration file.
Here is a sample configuration file:```yaml
---
- description: Wash hair
period: 2
on_command: 'curl -H "Title: Wash hair" -d "Wash your hair today." https://ntfy.sh/peroutine'
off_command: 'curl -H "Title: Don''t wash hair" -d "Don''t Wash your hair today." https://ntfy.sh/peroutine'
on_time: 23
off_time: 23
one_date: 2022-12-05
- description: Wash clothes
period: 8
on_command: 'curl -H "Title: Wash clothes" -d "Wash your clothes today." https://ntfy.sh/peroutine'
on_time: 9
one_date: 2022-12-06
```The configuration file is a list of periodical events.
The period is specified as the number of days.
The `on_command` and `off_command` are the commands to run when the event is on or off today.
The `on_time` and `off_time` are the times to run the commands.
The `one_date` is one date when the event is on.The `description`, `period`, and `one_date` are required.
Other fields are optional.You can run `peroutine list` to see all the events, grouped by the status (*on* or *off* today).
For example, with the above configuration file, the output of this command on 2022-12-05 is:```plain
On today:
Wash hairOff today:
Wash clothes
```The `peroutine cronjob` command runs the `on_command` and `off_command` specified in the configuration file
according to the current time and the `on_time` and `off_time`.
This command is intended to be run hourly as a cron job.
For example, you can add the following line to your crontab:```cron
0 * * * * /path/to/peroutine cronjob
```## Tips
You can use [ntfy](https://ntfy.sh) or [libnotify](https://gitlab.gnome.org/GNOME/libnotify) to send notifications
in the `on_command` and `off_command`.