{"id":13753364,"url":"https://github.com/saket13/iBatteryStats","last_synced_at":"2025-05-09T20:35:29.547Z","repository":{"id":159405479,"uuid":"251064457","full_name":"saket13/iBatteryStats","owner":"saket13","description":"🔋 Battery Usage Monitoring For Mac OS.....","archived":false,"fork":false,"pushed_at":"2020-08-21T12:43:35.000Z","size":2516,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-16T05:32:44.266Z","etag":null,"topics":["bash-script","battery","battery-life","capacity","cycle-count","darwin","dumper","macos","mojave","python-script","statusbar"],"latest_commit_sha":null,"homepage":"https://saket13.github.io/ibatterystats-page/","language":"Python","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/saket13.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-03-29T15:24:04.000Z","updated_at":"2024-02-10T18:17:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"9ceb76e8-1c34-4ab9-9304-c7624cfed7bb","html_url":"https://github.com/saket13/iBatteryStats","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saket13%2FiBatteryStats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saket13%2FiBatteryStats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saket13%2FiBatteryStats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saket13%2FiBatteryStats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saket13","download_url":"https://codeload.github.com/saket13/iBatteryStats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253321875,"owners_count":21890485,"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":["bash-script","battery","battery-life","capacity","cycle-count","darwin","dumper","macos","mojave","python-script","statusbar"],"created_at":"2024-08-03T09:01:20.993Z","updated_at":"2025-05-09T20:35:24.530Z","avatar_url":"https://github.com/saket13.png","language":"Python","funding_links":[],"categories":["System Status"],"sub_categories":["Local System Status"],"readme":"# iBatteryStats 🔋                                                \n\n[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)\n![Py2app](https://img.shields.io/pypi/pyversions/py2app)\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n[![made-with-bash](https://img.shields.io/badge/Made%20with-Bash-1f425f.svg)](https://www.gnu.org/software/bash/)\n[![GitHub license](https://img.shields.io/github/license/saket13/iBatteryStats)](https://github.com/saket13/iBatteryStats/blob/master/LICENSE)\n\nI use MacOS X(10.14.5) Mojave and Apple removed the option to show the battery time remaining in the statusbar since the macOS X(10.12.2) release.**iBatteryStats** is a MacOSX menu bar app 👨🏻‍💻 built to keep an eye on *slowly dying macbook battery* . Dedicated to all Apple MacBook Users with ❤️. \n\n*****Find the Project's Github Link Here👇*****\n\n[![Project Link](https://img.shields.io/badge/iBatteryStats🔋-Github-green.svg?style=for-the-badge)](https://github.com/saket13/iBatteryStats)\n\n## Screenshots\n\n**Charging \u0026 Discharging:**\n\n| ![Charging](Charging.png)  |  ![Discharging](Discharging.png) |\n|:---:|:---:|\n| CHARGING | DISCHARGING |\n\n**Low Battery Notification:**\n\n![Notification](Notification.png)\n\n## Design\n\nThis Apple Menu bar application has two parts \n- A **Bash script** that runs as a **cron job** and dumps battery stats to a log file, \n- A **Python script** that processes the log file to generate cumulative statistics like Charge Left, Status, Time Left, Cycles and Temperature etc \u0026 \n- Everything has been wrapped to a Status bar app using Rumps.\n\nI've also modified the Python script that is being run to alert you (via **Rumps Desktop Notification Feature**) of 'Charge Your Mac' in the last 15 and 10 mins remaining.\n\n## Package Structure\n    \n    iBatterstats.app.zip      # Root Package (ZIP Format)\n    .\n    ├── Contains              # For data handling.\n    │   ├── Python Script     # Reads LOG file stats\n    │   ├── BASH Script       # Dumps stats to LOG File     \n    │   └── LOG File          # Contains all stats updated through crontab\n    |\n    └── IBatteryStats     \n    \n## Installation\n\nClone the repo and install Rumps\n\n```bash\ngit clone https://github.com/saket13/iBatteryStats \nsudo chmod +x path_to_iBatteryStats/iBatteryStats/battery.sh\nsudo -H pip3 install rumps\n\n```\n\nAdd this line to your cron tab (`crontab -e`):\n\n     SHELL= /bin/bash   \n     */1 * * * * /bin/bash/ path_to_iBatteryStats/iBatteryStats/battery.sh \u003e path_to_iBatteryStats/iBatteryStats/back.log 2\u003e\u00261\n     # Here in crontab entry 1st argument says script is called every minute and second argument specifies where the script is and third where the log file is \n\nModify your python script to fetch values:\n\n```python\n#Enter the absolute address of the file here and leave everything as it is\nlog_file_path = 'path_to_iBatteryStats/iBatteryStats/back.log'\n\n```\n\n## Usage\n\nYou can simply do:\n\n```python\nnohup python3 path_to_iBatteryStats/iBatteryStats/battery.py \u0026\n\n```\nor to open the Application with no opening of terminal and on a single click\n\n```bash\n#Modify the content of app_shell to ::\n\n#!/bin/sh\nnohup python3 path_to_iBatteryStats/iBatteryStats/battery.py \u0026\n\n# And give it full permission ::\n\nsudo chmod +x path_to_iBatteryStats/iBatteryStats/app_shell\n\n```     \n    \n## Future Ideas and TODOs\n\n* Integrate other power management tools.\n\n* Handle every second stats and update it .\n    * For now it is working every minute.\n\n* Make this, the data dumping cron job and a battery status menu bar app indicator all a part of a single big application?\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nSee [Contributing Guidelines](CONTRIBUTING.md). \n\n## Contact\nIf you need any help, you can connect with me.\n\nVisit:- [saketsaumya.info](https://saketsaumya.info)\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2020 Saket Saumya\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaket13%2FiBatteryStats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaket13%2FiBatteryStats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaket13%2FiBatteryStats/lists"}