{"id":28051474,"url":"https://github.com/clzoc/BattGUI","last_synced_at":"2025-05-12T01:03:19.483Z","repository":{"id":288367377,"uuid":"967805600","full_name":"clzoc/BattGUI","owner":"clzoc","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-17T03:46:45.000Z","size":5922,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-17T17:43:10.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clzoc.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,"zenodo":null}},"created_at":"2025-04-17T03:10:46.000Z","updated_at":"2025-04-17T10:51:02.000Z","dependencies_parsed_at":"2025-04-17T17:45:13.480Z","dependency_job_id":"4f3a800e-08e4-4afd-990d-40afdecc3ac6","html_url":"https://github.com/clzoc/BattGUI","commit_stats":null,"previous_names":["clzoc/battgui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clzoc%2FBattGUI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clzoc%2FBattGUI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clzoc%2FBattGUI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clzoc%2FBattGUI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clzoc","download_url":"https://codeload.github.com/clzoc/BattGUI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253655955,"owners_count":21943081,"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":[],"created_at":"2025-05-12T01:03:17.515Z","updated_at":"2025-05-12T01:03:19.463Z","avatar_url":"https://github.com/clzoc.png","language":"Swift","readme":"# Power Management Suite\n\n[![Swift](https://img.shields.io/badge/Swift-5.9-orange.svg)]()\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\nA comprehensive power monitoring solution for macOS featuring:\n\n- 🖥 GUI application with real-time power flow visualization\n- 🔋 Detailed battery health analytics\n- ⚡️ CLI tools for low-level power monitoring\n- 📊 System load statistics collection\n\n- Initial app icon (This icon is open to creative reinterpretation by anyone.)\n\n\u003cimg src=\"image/Icon/a_batt_0.png\" alt=\"App Icon Preview\" height=\"150\"\u003e \u003cimg src=\"image/capture0.png\" alt=\"App Capture 0\" height=\"150\"\u003e \u003cimg src=\"image/capture1.png\" alt=\"App Capture 1\" height=\"150\"\u003e\n\n## Architecture Overview\n\n```mermaid\ngraph TD\n    Suite[Power Management Suite] --\u003e GUI{GUI Application}\n    \n    GUI --\u003e App[appApp.swift]\n    App --\u003e CV[ContentView.swift]\n    CV --\u003e PFV[PowerFlowView.swift]\n    CV --\u003e BM[Battery.swift]\n    \n    BM --\u003e OC[powerInfo.m Objective-C Bridge]\n    OC --\u003e SMC[\"SMC API (System Management Controller)\"]\n    \n    PFV --\u003e SW[\"SwiftUI Graphics Pipeline\"]\n    App --\u003e SM[StatusBar Menu]\n    SM --\u003e POP[\"Popover Window (NSHostingView)\"]\n    SM --\u003e MM[Menu Items]\n    \n    classDef swift fill:#F05138,color:white;\n    classDef objc fill:#4381ff,color:white;\n    classDef system fill:#666,color:white;\n    classDef suite fill:#8e44ad,color:white;\n    \n    class Suite suite\n    class App,CV,PFV,BM,SW,SM,POP,MM swift\n    class OC objc\n    class SMC system\n```\n\n## Features\n\n### GUI Application\n- Real-time power flow visualization\n- Battery health monitoring (cycles, capacity, temperature)\n- Adapter power input tracking\n- System load/power consumption correlation\n\n## Requirements\n\n- macOS 13 Ventura or newer\n- Xcode 15+\n- Administrative privileges for SMC access\n\n## Installation\n\n### DMG Installation\n1. Download the latest `.dmg` package from our [Releases page](https://github.com/clzoc/BattGUI/releases)\n2. Open the downloaded DMG file\n3. Drag the application to your `Applications` folder\n\n### Manual Installation (From Source)\n1. Build the application:\n```bash\n# Clone repository\ngit clone https://github.com/clzoc/BattGUI.git\ncd power-suite\nxcodebuild -workspace app.xcodeproj/project.xcworkspace -scheme app\n```\n\n2. Install required components:\n```bash\nsudo batt install --allow-non-root-access\n```\n\n### Alternative Installation\n1. **GateKeeper Configuration**\n   If you encounter security warnings:\n   - Go to `System Settings` → `Privacy \u0026 Security` → scroll down to `Security`\n   - Click \"Open Anyway\" next to the BattGUI warning\n   - Confirm execution in the dialog\n\n2. **Advanced Configuration (Admin required)**\n   For system-level monitoring access:\n```bash\n# Temporarily disable GateKeeper (resets after reboot)\nsudo spctl --master-disable\n```\n## Usage\n\nGUI Application:\n```bash\nopen app/build/Release/app.app\n```\n\n\n## Known Issues\n\n- **Adapter Voltage Detection**: Current implementation fixes adapter voltage at 20.00V due to missing SMC key in [VirtualSMC documentation](https://github.com/acidanthera/VirtualSMC/blob/master/Docs/SMCKeys.txt). Amperage is calculated using I = P / U. Contributions welcome to identify the correct SMC key.\n\n- **UI/UX Optimization**: Ongoing improvements to power management workflows including:\n  - Enhanced real-time measurement visualization\n  - Historical data trending\n  - Customizable power profiles\n\n- **GUI Charge Limit Adjustment Permission Denied**: When attempting to adjust battery charge limit through the GUI, users encounter permission errors depending on installation method.\n\n  ## Affected Components\n  - `powerInfo.m` (Objective-C)\n  - Unix domain socket: `/var/run/batt.sock`\n  - GUI slider control\n\n  ## Symptoms\n  | Installation Method | Behavior | Command |\n  |---------------------|----------|---------|\n  | With `--allow-non-root-access` | ✅ Works correctly | `sudo batt install --allow-non-root-access` |\n  | Default installation | ❌ \"Permission denied\" error | `sudo batt install` |\n\n  ## Technical Details\n  ### Root Cause\n  The Unix domain socket (`/var/run/batt.sock`) implements strict permission controls:\n  - Default mode: 600 (root-only)\n  - With flag: 666 (world-readable/writable)\n\n  ### Error Reproduction\n  1. Install without special flags\n  2. Launch GUI application\n  3. Attempt to move charge limit slider\n  4. Observe error in system logs:\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.\n\n## License\nGPLv3 (see [LICENSE](LICENSE))\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclzoc%2FBattGUI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclzoc%2FBattGUI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclzoc%2FBattGUI/lists"}