{"id":13592001,"url":"https://github.com/tshakalekholoane/bat","last_synced_at":"2025-05-16T12:00:19.590Z","repository":{"id":40358935,"uuid":"329390966","full_name":"tshakalekholoane/bat","owner":"tshakalekholoane","description":"Battery management utility for Linux laptops.","archived":false,"fork":false,"pushed_at":"2025-05-12T03:37:58.000Z","size":132,"stargazers_count":315,"open_issues_count":7,"forks_count":25,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-13T18:15:47.618Z","etag":null,"topics":["asus","bash","battery","battery-level","battery-life","battery-management-system","battery-monitor","go","golang","linux","linux-kernel","sh","systemd","utilities","utility","utils"],"latest_commit_sha":null,"homepage":"https://tshaka.dev/x/bat","language":"Go","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/tshakalekholoane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2021-01-13T18:02:46.000Z","updated_at":"2025-05-12T16:26:42.000Z","dependencies_parsed_at":"2024-01-16T05:22:47.036Z","dependency_job_id":"75fbd1af-1522-49b3-aa45-35962762063f","html_url":"https://github.com/tshakalekholoane/bat","commit_stats":{"total_commits":105,"total_committers":6,"mean_commits":17.5,"dds":0.6190476190476191,"last_synced_commit":"4662a713d84a175802a0f0b0582445298f514a61"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tshakalekholoane%2Fbat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tshakalekholoane%2Fbat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tshakalekholoane%2Fbat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tshakalekholoane%2Fbat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tshakalekholoane","download_url":"https://codeload.github.com/tshakalekholoane/bat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254527071,"owners_count":22085917,"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":["asus","bash","battery","battery-level","battery-life","battery-management-system","battery-monitor","go","golang","linux","linux-kernel","sh","systemd","utilities","utility","utils"],"created_at":"2024-08-01T16:01:04.700Z","updated_at":"2025-05-16T12:00:19.280Z","avatar_url":"https://github.com/tshakalekholoane.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# `bat`\n\n[![Go Reference](https://pkg.go.dev/badge/tshaka.dev/x/bat.svg)](https://pkg.go.dev/tshaka.dev/x/bat)\n![Continuous Integration](https://github.com/tshakalekholoane/bat/actions/workflows/ci.yaml/badge.svg)\n\n```                                     bat(1)\nNAME\n    bat - battery management utility for Linux laptops\n\nSYNOPSIS\n    bat [-d | --debug] [-h | --help] [-v | --version]\n        \u003ccommand\u003e [\u003carg\u003e]\n\nOPTIONS\n    -d, --debug\n        Display debug information.\n\n    -h, --help\n        Print this help document.\n\n    -v, --version\n        Display version information and exit.\n\nCOMMANDS\n    capacity\n        Print the current battery level.\n\n    health\n        Print the battery health status.\n\n    persist\n        Persist the current threshold between restarts.\n\n    reset\n        Undoes the persistence setting of the charging threshold between\n        restarts.\n\n    status\n        Print the charging status.\n\n    threshold num\n        Print the current charging threshold limit.\n\n        If num is specified (which should be a value between 1 and 100) this\n        will set a new charging threshold limit.\n```\n\n## About\n\nThe goal is to replicate the functionality of the [ASUS Battery Health Charging](https://www.asus.com/us/support/FAQ/1032726/) utility for ASUS laptops on Windows which aims to prolong the battery's life-span \u003ca href=\"https://electrek.co/2017/09/01/tesla-battery-expert-recommends-daily-battery-pack-charging/\"\u003e\u003csup\u003e1\u003c/sup\u003e\u003c/a\u003e \u003ca href=\"https://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries\"\u003e\u003csup\u003e2\u003c/sup\u003e\u003c/a\u003e.\n\n## Disclaimer\n\nThis has been reported to only work with some ASUS and [Lenovo ThinkPad](https://github.com/tshakalekholoane/bat/discussions/23) laptops only. For Dell systems, see [smbios-utils](https://github.com/dell/libsmbios), particularly the `smbios-battery-ctl` command, or install it using your package manager. For other manufacturers there is also [TLP](https://linrunner.de/tlp/).\n\nThere have also been some [problems setting the charging threshold inside of a virtual machine](https://github.com/tshakalekholoane/bat/issues/3#issuecomment-858581495).\n\n## Installation\n\nPre-compiled binaries (Linux x86-64) are available from the [GitHub releases page](https://github.com/tshakalekholoane/bat/releases), the latest of which can be downloaded from [here](https://github.com/tshakalekholoane/bat/releases/download/1.2/bat).\n\nAfter downloading the binary, give it permission to execute on your system by running the following command. For example, assuming the binary is located in the user's Downloads folder:\n\n```shell\nchmod +x $HOME/Downloads/bat\n```\n\nAlternatively, the application can be build from source by running the following command in the root directory of this repository. This requires a working version of [Make](https://www.gnu.org/software/make/) and [Go](https://golang.org/).\n\n```shell\nmake build\n```\n\n**Tip**: Create a symbolic link of the resulting binary in a directory that is in the `$PATH` environment variable such as `/usr/local/bin/`. This will allow any user to execute the program from anywhere on the system.\n\n```shell\nln -s $HOME/Downloads/bat /usr/local/bin/bat\n```\n\nYou can also rename the binary to something else if another program with the same name already exists i.e. [bat](https://github.com/sharkdp/bat).\n\n## Examples\n\n```shell\n# Print the current battery charging threshold.\nbat threshold\n\n# Set a new charging threshold, say 80% (requires superuser\n# permissions).\nsudo bat threshold 80\n\n# Persist the current charging threshold setting between restarts\n# (requires superuser permissions).\nsudo bat persist\n```\n\n## Requirements\n\nLinux kernel version later than 5.4-rc1 which is the [earliest version to expose the battery charging threshold variable](https://github.com/torvalds/linux/commit/7973353e92ee1e7ca3b2eb361a4b7cb66c92abee).\n\nTo persist the threshold setting between restarts, the application relies on [systemd](https://systemd.io/) version 244 or later, which is bundled with most Linux distributions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftshakalekholoane%2Fbat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftshakalekholoane%2Fbat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftshakalekholoane%2Fbat/lists"}