Giter Site home page Giter Site logo

cyrinux / asahi-battery-threshold Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paddim8/asahi-battery-threshold

0.0 1.0 0.0 1.53 MB

A small daemon for setting a charging threshold on Asahi Linux systems

License: MIT License

Shell 10.41% Rust 89.59%

asahi-battery-threshold's Introduction

asahi-battery-threshold

A small daemon that makes it possible to set a charging threshold for laptops running Asahi Linux.

How it works

Since the kernel-side doesn't yet support setting an actual threshold, this daemon monitors battery usage and interacts with files in /sys/class/power_supply/macsmc-battery/ to enable/disable charging. It can not change the charging behaviour during sleep.

Preventing the battery from charging after a certain point is useful when you have it plugged in for extended periods of time, in order to put less strain on the battery. By default, this program will prevent charging after reaching 85% capacity.

Installation

On Arch-based systems, the program can be installed with the following command:

makepkg -si

It can then be started by running

systemctl start asahi-battery-threshold

or

asahi-battery-threshold

Auto-start

systemctl enable asahi-battery-threshold

Usage

Default configuration path

The default configuration file is located in /etc/asahi-battery-threshold.conf.

Command-line

The program takes at most one command line argument, containing a path to a config file. Below is an example of a config file:

stop_charging_threshold = 85
start_charging_threshold = 80

Note: The program requires root privileges in order to change the charging behaviour.

Logging

Logging can be turned off by setting the CHARGE_LOG_LEVEL environment variable to off.

asahi-battery-threshold's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.