{"id":17700532,"url":"https://github.com/cdown/battery-notify","last_synced_at":"2026-03-02T03:33:01.030Z","repository":{"id":153279328,"uuid":"628432073","full_name":"cdown/battery-notify","owner":"cdown","description":"A simple battery notifier for Linux.","archived":false,"fork":false,"pushed_at":"2025-02-20T15:23:00.000Z","size":151,"stargazers_count":19,"open_issues_count":11,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-15T23:07:48.565Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/cdown.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":"2023-04-15T23:29:31.000Z","updated_at":"2025-04-20T15:29:06.000Z","dependencies_parsed_at":"2023-09-24T05:11:29.094Z","dependency_job_id":"75741a32-a613-445a-8295-ea22e243af99","html_url":"https://github.com/cdown/battery-notify","commit_stats":{"total_commits":128,"total_committers":3,"mean_commits":"42.666666666666664","dds":0.25,"last_synced_commit":"f75384ec7c81d9742ee430f627f217531c2835f9"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/cdown/battery-notify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Fbattery-notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Fbattery-notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Fbattery-notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Fbattery-notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdown","download_url":"https://codeload.github.com/cdown/battery-notify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Fbattery-notify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29991797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"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":"2024-10-24T17:42:28.814Z","updated_at":"2026-03-02T03:33:01.013Z","avatar_url":"https://github.com/cdown.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# battery-notify | [![Tests](https://img.shields.io/github/actions/workflow/status/cdown/battery-notify/ci.yml?branch=master)](https://github.com/cdown/battery-notify/actions?query=branch%3Amaster)\n\nbattery-notify is a small, Linux-only program that sends notifications on\nchanges to system or Bluetooth battery state.\n\n## Features\n\n- Small, easy to understand codebase\n- Notifications on battery state change\n- Bluetooth battery support\n- Works with multiple system batteries\n- Warnings on low/critical battery percentages\n- Warnings when connected to an external monitor but not mains power (X11 only)\n- Ability to sleep the computer with a custom command on critical percentage\n\n## Installation\n\n    cargo install battery-notify\n\nDefault features:\n\n- `mons`: Support `warn_on_mons_with_no_ac`. Adds a dependency on the x11rb\n  crate.\n- `bluetooth`: Support `bluetooth_low_pct`. Adds a dependency on the zbus\n  crate. You will also need to run `bluetoothd` with the `--experimental` flag\n  to expose battery information.\n\nIf you don't want to use some subset of these features, you can pass\n`--no-default-features` and select the ones you do want with `--feature`.\n\n## Usage\n\nRun `battery-notify`. You'll also need a notification daemon capable of\ndisabling [Desktop Notifications][], like\n[dunst](https://github.com/dunst-project/dunst) or similar.\n\n## Configuration\n\nYou can configure battery-notify at `~/.config/battery-notify/config.toml` --\non first run, this will be populated with a basic config if it doesn't exist.\n\nThe default config is:\n\n```toml\n# How often to check battery status, in seconds.\ninterval_secs = 30\n\n# At what percentage of battery capacity to notify about low battery.\nlow_pct = 40\n\n# At what percentage of battery capacity to notify and run sleep_command.\nsleep_pct = 15\n\n# The command to run when sleeping. Bear in mind that if you run as an\n# unprivileged user, you may need to consider elevation, either with NOPASSWD\n# or things like polkit.\nsleep_command = 'systemctl suspend'\n\n# If this many monitors are connected (that is, plugged in -- they can be off)\n# and we are discharging, show a warning. Intended to avoid cases where power\n# is inadvertently disconnected at a desk.\n#\n# Set to 0 to disable.\nwarn_on_mons_with_no_ac = 2\n\n# If a bluetooth device is below this percentage, notify about low battery.\n# Note that you need to run bluetoothd with --experimental in order for it to\n# expose battery information.\n#\n# Set to 0 to disable.\nbluetooth_low_pct = 40\n```\n\n## Output\n\nIf you don't like the output, you can disable logging with `RUST_LOG=none`.\n\n[Desktop Notifications]: https://specifications.freedesktop.org/notification-spec/latest/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdown%2Fbattery-notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdown%2Fbattery-notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdown%2Fbattery-notify/lists"}