Giter Site home page Giter Site logo

arsabe75 / bat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tshakalekholoane/bat

0.0 0.0 0.0 139 KB

Battery management utility for Linux laptops.

Home Page: https://tshaka.dev/x/bat

License: MIT License

Go 73.83% Makefile 9.45% Roff 16.72%

bat's Introduction

bat

Go Reference Continuous Integration

NAME
    bat - battery management utility for Linux laptops

SYNOPSIS
    bat [-d | --debug] [-h | --help] [-v | --version]
        <command> [<arg>]

OPTIONS
    -d, --debug
        Display debug information.

    -h, --help
        Print this help document.

    -v, --version
        Display version information and exit.

COMMANDS
    capacity
        Print the current battery level.

    health
        Print the battery health status.

    persist
        Persist the current threshold between restarts.

    reset
        Undoes the persistence setting of the charging threshold between
        restarts.

    status
        Print the charging status.

    threshold num
        Print the current charging threshold limit.

        If num is specified--which should be a value between 1 and 100--this
        will set a new charging threshold limit.

About

The goal is to replicate the functionality of the ASUS Battery Health Charging utility for ASUS laptops on Windows which aims to prolong the battery's life-span 1 2.

Disclaimer

This has been reported to only work with some ASUS and Lenovo ThinkPad laptops only. For Dell systems, see smbios-utils, particularly the smbios-battery-ctl command, or install it using your package manager. For other manufacturers there is also TLP.

There have also been some problems setting the charging threshold inside of a virtual machine.

Installation

Pre-compiled binaries (Linux x86-64) are available from the GitHub releases page, the latest of which can be downloaded from here.

After 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:

chmod +x $HOME/Downloads/bat

Alternatively, 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 and Go.

make build

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.

ln -s $HOME/Downloads/bat /usr/local/bin/bat

You can also rename the binary to something else if another program with the same name already exists i.e. bat.

Examples

# Print the current battery charging threshold.
bat threshold

# Set a new charging threshold, say 80% (requires superuser
# permissions).
sudo bat threshold 80

# Persist the current charging threshold setting between restarts
# (requires superuser permissions).
sudo bat persist

Requirements

Linux kernel version later than 5.4-rc1 which is the earliest version to expose the battery charging threshold variable.

To persist the threshold setting between restarts, the application relies on systemd version 244 or later, which is bundled with most Linux distributions.

bat's People

Contributors

tshakalekholoane avatar dependabot[bot] avatar pepa65 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.