{"id":33185699,"url":"https://github.com/UlyssesZh/peroutine","last_synced_at":"2025-11-22T04:01:31.866Z","repository":{"id":119372816,"uuid":"574644592","full_name":"UlyssesZh/peroutine","owner":"UlyssesZh","description":"Fuck the fact that the number of days in a week is prime","archived":false,"fork":false,"pushed_at":"2025-08-07T01:42:44.000Z","size":12,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T23:02:28.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UlyssesZh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-05T19:04:51.000Z","updated_at":"2025-08-07T01:42:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"c67745be-32c5-43ad-9f0e-d3e5751ff72c","html_url":"https://github.com/UlyssesZh/peroutine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/UlyssesZh/peroutine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UlyssesZh%2Fperoutine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UlyssesZh%2Fperoutine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UlyssesZh%2Fperoutine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UlyssesZh%2Fperoutine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UlyssesZh","download_url":"https://codeload.github.com/UlyssesZh/peroutine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UlyssesZh%2Fperoutine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285731803,"owners_count":27222214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-22T02:00:05.934Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-16T05:00:20.099Z","updated_at":"2025-11-22T04:01:31.860Z","avatar_url":"https://github.com/UlyssesZh.png","language":"Ruby","funding_links":[],"categories":["\u003ca name=\"organizers\"\u003e\u003c/a\u003eOrganizers and calendars"],"sub_categories":[],"readme":"# peroutine\n\nRemind you of periodical events.\nThe period can be any positive integer of days.\n(Work around the fact that the number of days in a week is prime!)\n\n## Installation\n\n[Install Ruby](https://www.ruby-lang.org/en/documentation/installation),\nand then put the `peroutine` file in a directory in your `$PATH`.\nRemember to add execution permission to the file.\n\n## Usage\n\nFirst, run `peroutine edit` to edit the configuration file.\nHere is a sample configuration file:\n\n```yaml\n---\n- description: Wash hair\n  period: 2\n  on_command: 'curl -H \"Title: Wash hair\" -d \"Wash your hair today.\" https://ntfy.sh/peroutine'\n  off_command: 'curl -H \"Title: Don''t wash hair\" -d \"Don''t Wash your hair today.\" https://ntfy.sh/peroutine'\n  on_time: 23\n  off_time: 23\n  one_date: 2022-12-05\n- description: Wash clothes\n  period: 8\n  on_command: 'curl -H \"Title: Wash clothes\" -d \"Wash your clothes today.\" https://ntfy.sh/peroutine'\n  on_time: 9\n  one_date: 2022-12-06\n```\n\nThe configuration file is a list of periodical events.\nThe period is specified as the number of days.\nThe `on_command` and `off_command` are the commands to run when the event is on or off today.\nThe `on_time` and `off_time` are the times to run the commands.\nThe `one_date` is one date when the event is on.\n\nThe `description`, `period`, and `one_date` are required.\nOther fields are optional.\n\nYou can run `peroutine list` to see all the events, grouped by the status (*on* or *off* today).\nFor example, with the above configuration file, the output of this command on 2022-12-05 is:\n\n```plain\nOn today:\nWash hair\n\nOff today:\nWash clothes\n```\n\nThe `peroutine cronjob` command runs the `on_command` and `off_command` specified in the configuration file\naccording to the current time and the `on_time` and `off_time`.\nThis command is intended to be run hourly as a cron job.\nFor example, you can add the following line to your crontab:\n\n```cron\n0 * * * * /path/to/peroutine cronjob\n```\n\nYou can also run `peroutine env` to edit the env file.\nFor example, one can use this in the env file:\n\n```sh\nENDPOINT=https://ntfy.sh/peroutine\nntfy() {\n\tcurl -H \"Title: $1\" -d \"$2\" $ENDPOINT\n}\n```\n\nThen, you can simply use something like `ntfy \"Wash hair\" \"Wash your hair today.\"`\nin the `on_command` and `off_command`.\nBehind the scenes, the commands are simply concatenated to the env file when executed.\n\n## Docker\n\nYou can deploy peroutine with Docker.\nFirst, put `config.yml` in `/path/to/config/config.yml`, and then use the following Docker compose file:\n\n```yaml\nservices:\n  peroutine:\n    container_name: peroutine\n    image: ulysseszhan/peroutine:master\n    volumes:\n      - /path/to/config:/root/.local/share/peroutine\n    environment:\n      TZ: America/Los_Angeles\n```\n\nThe `TZ` environment variable is important.\n\nIf your `config.yml` utilizes some commands that are not available in the Docker image,\nyou can install it by creating a custom Dockerfile.\nHere is an example for adding the `curl` command:\n\n```dockerfile\nFROM ulysseszhan/peroutine:master\nRUN apk add --no-cache curl\n```\n\nThen, replace the `image` field in the Docker compose file with a `build` field.\nIf you use a Dockerfile like this, to update the image, you need to run\n`docker compose up --build --force-recreate --no-deps`.\n\nTo have an env file when using Docker,\nyou need to put the env file in `/path/to/config/env.sh`.\n\n## Tips\n\nYou can use [ntfy](https://ntfy.sh) or [libnotify](https://gitlab.gnome.org/GNOME/libnotify) to send notifications\nin the `on_command` and `off_command`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUlyssesZh%2Fperoutine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FUlyssesZh%2Fperoutine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUlyssesZh%2Fperoutine/lists"}