{"id":22840574,"url":"https://github.com/shouya/batry","last_synced_at":"2025-07-24T13:01:58.462Z","repository":{"id":185021200,"uuid":"672863477","full_name":"shouya/batry","owner":"shouya","description":"Battery status monitor","archived":false,"fork":false,"pushed_at":"2025-02-28T12:05:27.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T02:54:28.213Z","etag":null,"topics":["battery","battery-monitor","dbus","status-bar","upower","widget"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/shouya.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}},"created_at":"2023-07-31T10:39:42.000Z","updated_at":"2025-02-28T12:05:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"2e470335-9e81-4994-af09-4ec834823f51","html_url":"https://github.com/shouya/batry","commit_stats":null,"previous_names":["shouya/batry"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouya%2Fbatry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouya%2Fbatry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouya%2Fbatry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouya%2Fbatry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shouya","download_url":"https://codeload.github.com/shouya/batry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246418621,"owners_count":20773933,"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","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","battery-monitor","dbus","status-bar","upower","widget"],"created_at":"2024-12-13T01:12:44.347Z","updated_at":"2025-03-31T04:29:18.716Z","avatar_url":"https://github.com/shouya.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Battery status monitor\n\nThis is a small program that monitors battery status through\n[UPower](https://upower.freedesktop.org/)'s DBus interface and outputs\nstatus updates as JSON.\n\nI use it to serve battery information for the battery widget on my\nstatus bar.\n\n### Reported information\n\n- battery percentage\n- wattage information\n- status (charging, discharging, fully_charged, not_charging, unknown)\n- time to full\n- time to empty\n\n### Features\n\n- Notification-based: The program is notified of changes, not polling for them.\n  + Optionally, you can specify a force polling interval (`--min-poll-interval`) if you want.\n- Alert: Run a custom alert command on low battery.\n- Repeated alert: Run the alert command every X seconds if the battery remains low.\n- Lightweight: The program is carefully crafted and uses negligible resources.\n\n### Usage\n\n``` text\n$ batry --help\nUsage: batry [OPTIONS]\n\nOptions:\n  -i, --min-poll-interval \u003cMIN_POLL_INTERVAL\u003e\n          Minimal polling interval in seconds. If not set, the monitor will only poll when the power source or battery status changes.\n  -t, --alert-threshold \u003cALERT_THRESHOLD\u003e\n          Alert threshold in percent. If the battery percentage is below this threshold, the alert command will be executed [default: 10].\n  -c, --alert-command \u003cALERT_COMMAND\u003e\n          Command to execute when the battery percentage is below the alert threshold. The command will be executed with `sh -c`.\n  -r, --alert-refire-interval \u003cALERT_REFIRE_INTERVAL\u003e\n          Refire interval in seconds. The alert command will only be executed once every `alert_refire_interval` seconds as long as the battery percentage is below the alert threshold.\n  -h, --help\n          Print help.\n  -V, --version\n          Print version.\n\n```\n\nThe output in each line is in JSON format.\n\n### Build\n\nYou can run `cargo build --release` to build the program.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshouya%2Fbatry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshouya%2Fbatry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshouya%2Fbatry/lists"}