{"id":21452927,"url":"https://github.com/arindas/batnotify","last_synced_at":"2025-07-29T12:32:26.633Z","repository":{"id":48838098,"uuid":"242371812","full_name":"arindas/batnotify","owner":"arindas","description":"Low battery notifier bash script and systemd service","archived":false,"fork":false,"pushed_at":"2024-09-14T12:40:38.000Z","size":11,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-15T02:34:17.152Z","etag":null,"topics":["bash","systemd-service","systemd-timer"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/arindas.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}},"created_at":"2020-02-22T16:17:04.000Z","updated_at":"2025-06-13T07:20:43.000Z","dependencies_parsed_at":"2024-11-23T06:45:09.034Z","dependency_job_id":null,"html_url":"https://github.com/arindas/batnotify","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/arindas/batnotify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arindas%2Fbatnotify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arindas%2Fbatnotify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arindas%2Fbatnotify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arindas%2Fbatnotify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arindas","download_url":"https://codeload.github.com/arindas/batnotify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arindas%2Fbatnotify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267686522,"owners_count":24127716,"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-07-29T02:00:12.549Z","response_time":2574,"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":["bash","systemd-service","systemd-timer"],"created_at":"2024-11-23T04:33:06.555Z","updated_at":"2025-07-29T12:32:26.605Z","avatar_url":"https://github.com/arindas.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# batnotify\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![init-systemd](https://img.shields.io/badge/init-systemd-brightgreen)\n\nNotification script and systemd timer for triggering low battery notifications.\n\n## How it works\nWe query battery state and charge percentage by reading from:\n- `/sys/class/power_supply/BAT0/status`\n- `/sys/class/power_supply/BAT0/capacity`\n\nIf the battery state is \"discharging\" and the current charge percentage is less than the\nspecified `${SAFE_BATTERY_LEVEL}`, we trigger a notification using `notify-send`\n\nNow we run the script using a systemd service file. In order to repeatedly check\nthe status, we run a systemd timer for the corresponding service file.\n\n## Installation\n\n```sh\n# clone the repo\ngit clone git@github.com:arindas/batnotify.git\ncd batnotify/\n\n# install the relevant files\ncp ./batnotify ~/.local/bin\ncp ./batnotify.service ~/.config/systemd/user\ncp ./batnotify.timer ~/.config/systemd/user\n\n# enable and start the systemd service timer\nsystemctl --user enable batnotify.timer\nsystemctl --user start batnotify.timer\n```\n\n## Uninstallation\n```sh\n# disable and stop the systemd service timer\nsystemctl --user disable batnotify.timer\nsystemctl --user stop batnotify.timer\n```\n\n## See also\n- [`poweralertd`](https://sr.ht/~kennylevinsen/poweralertd/): Also handles power notifications for different wireless devices, in addition to main system power.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farindas%2Fbatnotify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farindas%2Fbatnotify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farindas%2Fbatnotify/lists"}