{"id":20622611,"url":"https://github.com/myterminal/power-guard","last_synced_at":"2026-02-15T12:37:54.039Z","repository":{"id":76221168,"uuid":"545575988","full_name":"myTerminal/power-guard","owner":"myTerminal","description":"A battery protector for mobile computers","archived":false,"fork":false,"pushed_at":"2024-12-24T23:45:08.000Z","size":54,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T18:03:58.427Z","etag":null,"topics":["battery","common-lisp","lisp","sbcl"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","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/myTerminal.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":"2022-10-04T16:02:12.000Z","updated_at":"2024-12-24T23:45:12.000Z","dependencies_parsed_at":"2024-01-15T04:55:31.784Z","dependency_job_id":"e0d6f452-4db3-439d-8cd0-40b0d89a53c5","html_url":"https://github.com/myTerminal/power-guard","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/myTerminal/power-guard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myTerminal%2Fpower-guard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myTerminal%2Fpower-guard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myTerminal%2Fpower-guard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myTerminal%2Fpower-guard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myTerminal","download_url":"https://codeload.github.com/myTerminal/power-guard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myTerminal%2Fpower-guard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278655145,"owners_count":26022968,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"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":["battery","common-lisp","lisp","sbcl"],"created_at":"2024-11-16T12:23:58.441Z","updated_at":"2025-10-06T18:06:30.041Z","avatar_url":"https://github.com/myTerminal.png","language":"Common Lisp","funding_links":["https://ko-fi.com/Y8Y5E5GL7"],"categories":[],"sub_categories":[],"readme":"# power-guard\n\n[![Built with Lisp](https://img.shields.io/badge/built%20with-Lisp-blueviolet)](https://lisp-lang.org)\n[![License](https://img.shields.io/github/license/myTerminal/power-guard.svg)](https://opensource.org/licenses/MIT)  \n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Y8Y5E5GL7)\n\nA battery protector for mobile computers\n\n## Background\n\nContinuing to use your computer when the battery charge is critically low could lead to serious damage to the battery. You may never face this issue while using operating systems like Windows, macOS, or even \"ready-to-use\" Linux distributions like Ubuntu and Fedora. However, for minimal setups like Arch, Void, and similar distributions, you may have to be careful about the battery charge as there's mostly nothing in place to take care of it on your behalf.\n\n*power-guard* provides a simple command to fill in the gap by keeping a watch over the remaining battery charge and automatically suspending (or hibernating) your system to protect your battery from damage. You may also run it as a service with supported init systems.\n\n### Suspend vs Hibernate\n\n*power-guard* usually prefers `suspend` over `hibernate`, but performs the latter when there is more than one battery equipped. This could be handy in the absence of charging points nearby and the user can quickly swap the discharged battery with a charged one and resume working without turning the computer off.\n\n## Installation\n\nThere are a few different ways to get *power-guard*.\n\n### Compile from source\n\n    # Clone project to the local workspace\n    git clone https://github.com/myTerminal/power-guard.git\n\n    # Switch to the project directory\n    cd power-guard\n\n    # Install with `make`\n    make install\n\n### Automatic installation\n\nSimply execute the below command in a terminal; the rest should be automatic.\n\n    /bin/bash -c \"$(curl https://raw.githubusercontent.com/myTerminal/power-guard/main/install)\"\n\n### Through a package manager\n\n*power-guard* will soon be available to install from your operating system's package manager.\n\n## How to Use\n\nA simple way to use *power-guard* is to run it in a command-line terminal with no command arguments.\n\n    power-guard\n\nBy default, it watches the remaining charge on the battery and suspends (or hibernates) the computer when it drops below 10%. You can also optionally specify the minimum threshold percentage of charge as an argument.\n\n    power-guard 7\n\nThe above example only suspends the computer when the remaining charge is below 7%.\n\n### Running as a service\n\n*power-guard* can also be run as an init service, and currently only supports [Runit](http://smarden.org/runit). Support for more init systems will be implemented soon.\n\n### Further help with commands\n\nTo learn more about usage, refer to `manpage`:\n\n    man power-guard\n\n## Updating\n\nIn order to update *power-guard*, simply run:\n\n    power-guard-update\n\n## Uninstalling\n\nIn order to uninstall *power-guard*, simply run:\n\n    power-guard-uninstall\n\n## External Dependencies\n\nBeing written with Common Lisp, *power-guard* depends on [SBCL](https://www.sbcl.org). In most cases, it will be automatically installed while generating the binary, but if it doesn't please install it before running the installation.\n\nThe other required programs are as follows:\n\n - [find](https://man.archlinux.org/man/find.1.en)\n - [cat](https://man.archlinux.org/man/cat.1.en)\n - [command](https://man.archlinux.org/man/command.1p.en)\n\n## Optional External Dependencies\n\nBelow are a few more optional dependencies that are also attempted to be fetched during the installation:\n\n - [beep](https://pkgs.org/search/?q=beep)\n - [notify-send](https://man.archlinux.org/man/notify-send.1.en)\n\nIf not installed automatically, you may install them manually.\n\n## To-do\n\n* Improve reading of battery level, add support for more hardware types\n* Implement alternate methods of suspending the system\n* Add support for more init systems like OpenRC, SysVinit, etc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyterminal%2Fpower-guard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyterminal%2Fpower-guard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyterminal%2Fpower-guard/lists"}