{"id":41743416,"url":"https://github.com/equaeghe/batenergy","last_synced_at":"2026-01-25T00:36:04.626Z","repository":{"id":140073571,"uuid":"399933701","full_name":"equaeghe/batenergy","owner":"equaeghe","description":"Script to track laptop battery energy change during sleep states using systemd's system-sleep directory","archived":false,"fork":false,"pushed_at":"2025-08-20T11:32:57.000Z","size":21,"stargazers_count":26,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-20T13:27:26.811Z","etag":null,"topics":["battery-information","charge","discharge","hibernate","suspend","systemd"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/equaeghe.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":"2021-08-25T19:22:21.000Z","updated_at":"2025-08-20T11:43:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"b140792a-8c6c-4657-a7e5-dd9faa02ec02","html_url":"https://github.com/equaeghe/batenergy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/equaeghe/batenergy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equaeghe%2Fbatenergy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equaeghe%2Fbatenergy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equaeghe%2Fbatenergy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equaeghe%2Fbatenergy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/equaeghe","download_url":"https://codeload.github.com/equaeghe/batenergy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equaeghe%2Fbatenergy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28740005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["battery-information","charge","discharge","hibernate","suspend","systemd"],"created_at":"2026-01-25T00:36:04.130Z","updated_at":"2026-01-25T00:36:04.620Z","avatar_url":"https://github.com/equaeghe.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# batenergy\nScript to track laptop battery energy change during sleep states using systemd's system-sleep directory\n\n## Installation\nThis script should be copied to systemd's system-sleep directory.\nThis directory is normally already present at `/usr/lib/systemd/system-sleep` or `/lib/systemd/system-sleep`; check your Linux distribution's information resources if it isn't clear which.\nMake sure it is executable (`chmod +x batenergy.sh` as needed).\n\n## Usage\nOnce installed, the script will cause informative output about battery energy change (amount and rate, in absolute units and percentages) to be added to the system logs.\nThis information may be useful for troubleshooting both discharging and charging of the battery during sleep states.\n\nExample output, accessible using, e.g.,  `journalctl -u systemd-suspend.service`:\n\n```\nsystemd[1]: Starting System Suspend...\nsystemd-sleep[2096130]: Currently on battery.\nsystemd-sleep[2096130]: Saving time and battery energy before sleeping (suspend).\nsystemd-sleep[2096128]: Suspending system...\nsystemd-sleep[2096128]: System resumed.\nsystemd-sleep[2096235]: Currently on mains.\nsystemd-sleep[2096235]: Duration of 0 days 3 hours 26 minutes sleeping (suspend).\nsystemd-sleep[2096235]: Battery energy change of -4.5 % (-2320 mWh) at an average rate of -1.30 %/h (-673 mW).\nsystemd[1]: systemd-suspend.service: Deactivated successfully.\nsystemd[1]: Finished System Suspend.\n```\n\n## Caveats\nThis script has been tested on one laptop model.\nI may have made assumptions that do not hold for yours; use at your own risk.\nChecking (for) the files referenced in the script (and other files in the containing directories) may help you adapt it to your model.\n\n## Credits\nInspired by [Oliver Machacik's batdistrack](https://github.com/oliver-machacik/batdistrack).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequaeghe%2Fbatenergy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fequaeghe%2Fbatenergy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequaeghe%2Fbatenergy/lists"}