Giter VIP home page Giter VIP logo

batman's Introduction

Battery Management

Batman is a battery management service which tweaks different nodes and pieces of hardware in real time.

batman-gui is based on GTK4 and can tweak batman configuration file in real time.

Tested with Phosh, sxmo and Plasma Mobile. It should work with any wlroots or Kwin based environment.

It should be noted at this program has been tested on pmOS and Mobian (mainline) as well as Droidian, Manjaro Libhybris and AlpHybris (hybris).

upower must provide a proper battery status on /org/freedesktop/UPower/devices/DisplayDevice

It is currently available as a deb package, PKGBUILD and APKBUILD.

Not tested on Lomiri as it has integration for repowered.

Dependencies

The following packages have to be installed as dependencies to build batman:

For Debian based systems:

sudo apt install gcc make libupower-glib-dev pkg-config libwayland-dev libgtk-4-dev debhelper fakeroot libadwaita-1-dev

For Fedora based systems:

sudo dnf install upower-devel pkg-config wayland-devel gtk4-devel libadwaita-devel 'Development Tools'

For Arch based systems:

sudo pacman -S upower pkgconf wayland gcc make gtk4 libadwaita

For Alpine based systems:

sudo apk add upower-dev pkgconfig wayland-dev gcc make gtk4.0-dev libadwaita-dev

Everything can be compiled using the Makefile:

Building

make

And to install everything onto the system

sudo make install

And on Debian based systems to build and package batman

dpkg-buildpackage

And finally, to enable the service

sudo systemctl daemon-reload
sudo systemctl enable --now batman

Manual compilation

To build batman-helper manually you can use gcc:

gcc -DWITH_UPOWER -DWITH_WLRDISPLAY -DWITH_GETINFO src/batman-helper.c src/batman-wrappers.c src/wlrdisplay.c src/getinfo.c -o batman-helper -lwayland-client `pkg-config --cflags --libs upower-glib`

If you don't want wlrdisplay status support and want batman to use the old wlr-randr implementation, remove -DWITH_WLRDISPLAY and to use the older upower implementation, remove -DWITH_UPOWER. To not build the software with systemd batman status, remove -DWITH_GETINFO.

older wlr-randr and upower implementations are slower so it is recommended to compile batman-helper with upower and wlrdisplay support

To build batman-gui manually you can use gcc:

gcc src/batman-gui.c src/configcontrol.c src/getinfo.c -o batman-gui `pkg-config --cflags --libs gtk4`

To build governor manually:

gcc src/governor.c -o governor

To build libbatman-wrappers.so:

gcc -DWITH_UPOWER -DWITH_WLRDISPLAY -DWITH_GETINFO -fPIC -shared src/batman-wrappers.c src/wlrdisplay.c src/getinfo.c -o libbatman-wrappers.so -lwayland-client `pkg-config --cflags --libs upower-glib`

Example usage of these functions are available at examples/

Configuration

POWERSAVE Powersave allows CPU go into powersaving.

OFFLINE Offlining is the process of CPU cores shutting down. These two only activate when device is idling. They also save a lot of battery.

GPUSAVE GPU save allows GPU go into powersaving. This feature is still experimental.

CHARGESAVE Chargesave indicates whether or not put device to powersave when its charging up.

BUSSAVE This option allows devfreq bus nodes to be set to powersave. They also save a lot of battery.

MAX_CPU_USAGE This option tells batman at what CPU usage it should leave powersaving. as an example when listening to music in the background this item can be set to a lower value to make the device not set it to powersave to not make audio choppy

BTSAVE This option will allow batman to moderate bluetooth power management and switch states accordingly. it will check if it is connected and if something is using it and changes states accordingly

batman's People

Contributors

fakeshell avatar erikinkinen avatar joas329 avatar armgham avatar bettehem avatar g7 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.