GithubHelp home page GithubHelp logo

tshakalekholoane / bat Goto Github PK

View Code? Open in Web Editor NEW
256.0 7.0 22.0 124 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%
linux-kernel asus battery battery-monitor battery-life battery-level utilities golang utility utils

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

dependabot[bot] avatar pepa65 avatar tshakalekholoane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bat's Issues

Request procedure how to update the app

Hi! First of all i would like to Thank you for this great app. Working extremely well on my VivoBook_ASUSLaptop X415JA 1.0 running Linux Mint 21.1 x86_64 using kernel 5.15.0-58-generic with DE of Xfce 4.16

Unfortunately, i could not update this app. Downloading the latest version and applying the required permission and then substituting it to the older version does not work for me. Giving a guide or way how to update is much appreciated. I am currently running bat 0.10.1-0-gc5871eb-dirty version by the way.

feat: replace dependency on Bash with /bin/sh for cross-platform compatibility

Is your feature request related to a problem? Please describe.

Currently, the project relies on the Bash shell for executing certain commands. While Bash is a powerful and versatile shell, it may not be available or the default shell on all systems. To ensure cross-platform compatibility and accessibility for a wider range of users, replacing Bash with the system's default POSIX-compliant shell, typically found at /bin/sh should be considered.

Describe the solution you'd like

Modify the systemd unit template to use the expanded battery variable path and hardcode the the shell path. See the following discussion for more details #65 (comment).

Contributions

Contributions and suggestions on how to implement this change are welcome. If you have experience with shell scripting and cross-platform compatibility, please feel free to provide your insights and expertise.

Not works in ASUS ROG GL552-VW

Hi
I tested this tool on ASUS ROG GL552-VW and this message printed while setting the threshold:

$ sudo ./bat -t 80
This program is most likely not compatible with your system. See
https://github.com/leveson/bat#disclaimer.

Other commands like -c or -s work correctly.
I have ubuntu 20.10 and here is the output of uname -a:

Linux mojighahar 5.8.0-55-generic #62-Ubuntu SMP Tue Jun 1 08:21:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Please inform me if any other data required for clearing this issue. (output of lshw , ...)

issue: bat uninstall

Subject of the issue

Bat is easy to install and works fine in ubuntu/asus: how to uninstall it?

Your system

OS: Ubuntu 22.04 Linux x86_64
Host: ZenBook
Kernel: 5.15.0-27-generic

Version

0.8.4 (Latest)

Steps to reproduce

No response

Expected behaviour

No response

Actual behaviour

No response

Setting is not persisting after reboot

Hello! First of all, nice tiny package!
I want to issue something:

1

When i run bat -t 70, it asks for my root password but authentication fails every time.
If i then run sudo bat -t 70, no issue and setting is correctly set.

2

I run sudo bat -p multiple times but the threshold value at every restart is back at 100.
What can i do to make it persistent?

I'm using elementaryOS:

catta@catta-pc:~$ uname -a
Linux catta-pc 5.4.0-70-generic #78~18.04.1-Ubuntu SMP Sat Mar 20 14:10:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

is this only for Asus?

Hi Leveson,

I just bought an Ideapad to replace my T420 Thinkpad because I accidentally cracked the screen. I saw your answer on askubuntu I think and clicked to get here.
Does this work for Lenovo Ideapads?

Issue with battery status

Hi Leveson,

This works for my TUF series laptop but after I set to a value say 60, the status shows "unknown" instead of showing "Not charging". When I unplug, it shows as "Discharging".

My battery type is BAT1

Also, on Manjaro, I get some to start errors during startup. Please, let me know if there's anything to tinker with.

issue: Charging does not stop no matter if the laptop is running or sleeping

Subject of the issue

The charging seems to not stop at the intended threshold despite correct output from the program (I did not receive an error, like on an older laptop that probably just does not support the feature)

I am using KDE, and I am not really sure if it hibernates or suspends when I close the lid (the settings only have one option: "sleep"). I am also judging only by bat -c and the display in in the KDE System Tray, maybe this is just a display issue.

Your system

OS: Fedora 35 KDE Linux x86_64
Host: VivoBook Flip 14 (J412U)
Kernel: 5.14.9-200.fc34.x86_64
systemctl 248

Version

0.8.3 (Latest)

Steps to reproduce

What I did:

bat -t 65
bat -p
bat -t
>> 65

what I've tried after looking at #3
test -f /etc/systemd/system/bat.service && echo "TRUE" returns nothing

test -f /sys/class/power_supply/BAT?/charge_control_end_threshold && echo "TRUE" returns TRUE

systemctl status bat.service returns Unit bat.service could not be found.

systemctl status bat-sleep.service returns:

bat-sleep.service - Persist the battery charging threshold after sleep
     Loaded: loaded (/etc/systemd/system/bat-sleep.service; enabled; vendor preset: disabled)
     Active: inactive (dead)

Oct 05 15:25:31 fedora systemd[1]: Finished Persist the battery charging threshold after sleep.
Oct 05 15:57:43 fedora systemd[1]: Starting Persist the battery charging threshold after sleep...
Oct 05 15:57:43 fedora systemd[1]: bat-sleep.service: Deactivated successfully.
Oct 05 15:57:43 fedora systemd[1]: Finished Persist the battery charging threshold after sleep.
Oct 05 15:59:14 fedora systemd[1]: Starting Persist the battery charging threshold after sleep...
Oct 05 15:59:14 fedora systemd[1]: bat-sleep.service: Deactivated successfully.
Oct 05 15:59:14 fedora systemd[1]: Finished Persist the battery charging threshold after sleep.
Oct 05 16:02:51 fedora systemd[1]: Starting Persist the battery charging threshold after sleep...
Oct 05 16:02:51 fedora systemd[1]: bat-sleep.service: Deactivated successfully.
Oct 05 16:02:51 fedora systemd[1]: Finished Persist the battery charging threshold after sleep.

Expected behaviour

charging should stop at the threshold both when the lid is closed and when the device is running.

Actual behaviour

Both with closed lid or running system, the charging continues beyond the set limit. Shutdown and restart also did not have an effect on this. bat -t still reports the threshold I set correctly after restart.

I am clueless when it comes to systemd but judging by the output above it seems that

Not working. After connect charger battery charging. ASUS TUF Gaming F17 FX706HE_FX706HE 1.0

Subject of the issue

Not working. After connect charger battery charging.
┌──(root㉿kali-[/sys/class/power_supply]
└─# ls
ACAD BAT1

┌──(root㉿kali-[/sys/class/power_supply]
└─# ls -l
загалом 0
lrwxrwxrwx 1 root root 0 чер 25 16:08 ACAD -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0003:00/power_supply/ACAD
lrwxrwxrwx 1 root root 0 чер 25 16:06 BAT1 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT1

┌──(root㉿kali-[/sys/class/power_supply]
└─# ls -l
загалом 0
lrwxrwxrwx 1 root root 0 чер 25 16:08 ACAD -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0003:00/power_supply/ACAD
lrwxrwxrwx 1 root root 0 чер 25 16:06 BAT1 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT1

┌──(root㉿kali-[/sys/class/power_supply]
└─# cd /sys/class/power_supply/BAT1

┌──(root㉿kali-[/sys/class/power_supply/BAT1]
└─# ls -a
. capacity charge_full current_now hwmon1 power status type voltage_now
.. capacity_level charge_full_design cycle_count manufacturer present subsystem uevent
alarm charge_control_end_threshold charge_now device model_name serial_number technology voltage_min_design

┌──(root㉿kali-[/sys/class/power_supply/BAT1]
└─# ls -l
загалом 0
-rw-r--r-- 1 root root 4096 чер 26 08:52 alarm
-r--r--r-- 1 root root 4096 чер 25 16:08 capacity
-r--r--r-- 1 root root 4096 чер 26 08:52 capacity_level
-rw-r--r-- 1 root root 4096 чер 26 08:34 charge_control_end_threshold
-r--r--r-- 1 root root 4096 чер 25 16:08 charge_full
-r--r--r-- 1 root root 4096 чер 25 16:08 charge_full_design
-r--r--r-- 1 root root 4096 чер 25 16:08 charge_now
-r--r--r-- 1 root root 4096 чер 25 16:08 current_now
-r--r--r-- 1 root root 4096 чер 25 16:08 cycle_count
lrwxrwxrwx 1 root root 0 чер 26 00:27 device -> ../../../PNP0C0A:00
drwxr-xr-x 3 root root 0 чер 25 19:06 hwmon1
-r--r--r-- 1 root root 4096 чер 25 16:08 manufacturer
-r--r--r-- 1 root root 4096 чер 25 16:08 model_name
drwxr-xr-x 2 root root 0 чер 26 08:52 power
-r--r--r-- 1 root root 4096 чер 25 16:08 present
-r--r--r-- 1 root root 4096 чер 25 16:08 serial_number
-r--r--r-- 1 root root 4096 чер 25 16:08 status
lrwxrwxrwx 1 root root 0 чер 25 16:06 subsystem -> ../../../../../../class/power_supply
-r--r--r-- 1 root root 4096 чер 25 16:08 technology
-r--r--r-- 1 root root 4096 чер 25 16:08 type
-rw-r--r-- 1 root root 4096 чер 25 17:14 uevent
-r--r--r-- 1 root root 4096 чер 25 16:08 voltage_min_design
-r--r--r-- 1 root root 4096 чер 25 16:08 voltage_now

┌──(root㉿kali-[/sys/class/power_supply/BAT1]
└─# cat /sys/class/power_supply/BAT1/status
Charging

┌──(root㉿kali-[/sys/class/power_supply/BAT1]
└─# cat /sys/class/power_supply/BAT1/capacity
76

┌──(root㉿kali-[/sys/class/power_supply/BAT1]
└─# cat /sys/class/power_supply/BAT1/charge_control_end_threshold
50

┌──(root㉿kali-[/sys/class/power_supply/BAT1]
└─# echo 60 > /sys/class/power_supply/BAT1/charge_control_end_threshold

┌──(root㉿kali-[/sys/class/power_supply/BAT1]
└─# cat /sys/class/power_supply/BAT1/status
Unknown

If i take this command charging stopped

Your system

OS: Kali GNU/Linux Rolling x86_64
Host: ASUS TUF Gaming F17 FX706HE_FX706HE 1.0
Kernel: Linux 11 5.17.0-kali3-amd64 #1 SMP PREEMPT Debian 5.17.11-1kali1 (2022-05-30) x86_64 GNU/Linux
└─# bat -v
bat 0.9.1

Version

0.9.1 (Latest)

Steps to reproduce

No response

Expected behaviour

No response

Actual behaviour

No response

'This program is most likely not compatible with your system' on ASUS with Linux kernel 5.4.0-70

First, thanks for writing this and giving it to the community. I appreciate it. I just bought a new battery for my N750JV, but already it lasts only 60 minutes max... :-/ So, I was happy to come across your utility. However, when I enter

sudo ./bat --threshold 80

the utility tells me "This program is most likely not compatible with your system."

I have an ASUS N750JV with the latest BIOS upgrade and Linux kernel 5.4.0-70-generic. Could you explain what could be wrong?

Best regards, OmeCor

issue: Fails to build: cannot load embed: malformed module path "embed"

go build ./cmd/bat/ results in

build tshaka.co/bat/cmd/bat: cannot load embed: malformed module path "embed": missing dot in first path element

Steps to reproduce on Ubuntu 20.04:

cd ~/dev
git clone https://github.com/tshakalekholoane/bat.git
cd bat
sudo apt install golang-go
time go build ./cmd/bat/

output:

~/GS/dev/bat$ time go build ./cmd/bat/
build tshaka.co/bat/cmd/bat: cannot load embed: malformed module path "embed": missing dot in first path element

And a slightly different attempt (seems to have resolved the error above, but now results in a new one):

~/GS/dev/bat$ time go build cmd/bat/
can't load package: package cmd/bat: package cmd/bat is not in GOROOT (/usr/lib/go-1.13/src/cmd/bat)

build: create additional Make targets

Create convenience targets to install and reinstall the application where the latter removes the systemd unit files before pulling the latest changes by running bat reset if the application already exists.

The former should pull the changes i.e., git pull --rebase, build the application, and install it to /usr/local/bin.

See the following discussion for details : #73 (comment).

Threshold not persisting after reboot - systemctl 245

After running sudo bat -p the threshold value after restart is back at 100.

I checked a related issue #5. My version is greater than 244 you mentioned in there.

> systemctl --version
systemd 245 (245.4-4ubuntu3.11)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid

When I look at the generated file I see that there is a question mark after the BAT (BAT?) instead of it saying 0 (BAT0) and the location of bash is not correct (/usr/bin/bash instead of /bin/bash):

> more /etc/systemd/system/bat-boot.service 
[Unit]
Description=Persist the battery charging threshold after boot 
After=multi-user.target
StartLimitBurst=0

[Service]
Type=oneshot
Restart=on-failure
ExecStart=/usr/bin/bash -c 'echo 60 > /sys/class/power_supply/BAT?/charge_control_end_threshold'

[Install]
WantedBy=multi-user.target

Th following file works for me if I run sudo systemctl restart bat-boot.service:

[Unit]
Description=Persist the battery charging threshold after boot 
After=multi-user.target
StartLimitBurst=0

[Service]
Type=oneshot
Restart=on-failure
ExecStart=/bin/bash -c 'echo 60 > /sys/class/power_supply/BAT0/charge_control_end_threshold'

[Install]
WantedBy=multi-user.target

issue: Battery percentage setting doesn't persist; systemctl does not indicate that [email protected] is running.

Subject of the issue

Hi, I've downloaded and used the bat file from the Release page, version 0.13, following your instruction to the letter but the setting doesn't persist after restarting.

After running the bat, this is the services I see in systemctl:

Screenshot from 2023-09-17 20-21-51

When I run the following command in the Terminal after restarting:

systemctl --state=active --type=service

I do not see [email protected] running.

Screenshot from 2023-09-17 19-56-05

However, when I check for all services:

systemctl --type=service

I see that there's the service [email protected], but not activated
Screenshot from 2023-09-17 19-55-53

The service file is identical to that in your source code.

Your system

OS: Ubuntu 22.04.3 LTS x86_64
Host: ZenBook UX425EA_UX425EA 1.0
Kernel: 6.2.0-32-generic
Shell: bash 5.1.16
Resolution: 1920x1080
DE: Unity 7.6.0
WM: Compiz
Terminal: gnome-terminal

Version

0.13 (Latest)

Steps to reproduce

Download and run the bat file as per instructions, then restart/shutdown the laptop.

Expected behaviour

After restart/turn on, the service should automatically be activated by the systemd and the systemctl.

Running bat threshold should return the pre-determined value.

Actual behaviour

The service isn't run, not after restarting. Running bat threshold returns the default value (100).

bat-asus-battery-bin package on AUR failed to build

Subject of the issue

Latest AUR package of 0.9.1-1 is unable to build. Package manager returned the package as unable to build because one or more files did not pass validity check.

Pamac log:

Building bat-asus-battery-bin...
==> Making package: bat-asus-battery-bin 0.9.1-1
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found bat.zip
==> Validating source files with sha256sums...
    bat.zip ... FAILED
==> ERROR: One or more files did not pass the validity check!
Failed to build bat-asus-battery-bin

Please confirm and push a fix. Thank you.

Your system

OS: Manjaro Linux x86_64

Kernel: 5.15.41-1-MANJARO

Shell: zsh 5.9

DE: GNOME 42.2

Version

0.9.1 (Latest)

Steps to reproduce

Build in Pamac from AUR package.

Expected behaviour

Successful build.

Actual behaviour

Unable to build

feat: battery health command

Subject of the issue

There should be a command to check battery health which is the maximum storage capacity in percentage.

Eg.

  • health
    • Print the current battery health in percentage.

Your system

OS: Ubuntu 22.04 Linux x86_64
Host: Asus TUF A15 FA506IH
Kernel: 5.19.0-45-generic

Version

0.12 (Latest)

issue: when i run " # ./bat --threshold"

Subject of the issue

There is no --threshold option. Run bat --help to see a list of available options.

Your system

.............
..,;:ccc,. -------------------
......''';lxO. OS: Kali GNU/Linux Rolling x
.....''''..........,:ld;
.';;;:::;,,.x, Kernel: 5.18.0-kali7-amd64
..'''. 0Xxoc:,. ... Uptime: 42 mins
.... ,ONkc;,;cokOdc',. Packages: 5479 (dpkg), 15 (s
. OMo ':ddo. Shell: zsh 5.9
dMc :OO; Resolution: 1366x768
0M. .:o. DE: GNOME 43.0
;Wd WM: Mutter
;XO, WM Theme: Kali-Dark
,d0Odlc;,.. Theme: adw-gtk3-dark [GTK2/3
..',;:cdOOd::,. Icons: Flat-Remix-Blue-Dark
.:d;.':;. Terminal: gnome-terminal
'd, .'
;l ..
.o
c

Version

0.10.1 (Latest)

Steps to reproduce

No response

Expected behaviour

No response

Actual behaviour

No response

Charge threshold doesn't work with suspend-then-hibernate

Expected Behavior

After resuming from suspend-then-hibernate, if battery level is above charge threshold (80), it shouldn't be charging.

Actual Behavior

The battery is charging despite that battery level is above threshold (80) after resuming from suspend-then-hibernate.
bat -t correctly shows the threshold I configured. Manually setting charge threshold again makes it work properly.

Steps to reproduce

  1. Set threshold and persist. sudo bat -t 80 sudo bat -p.
  2. Set appropriate HibernateDelaySec (like 20 for testing) in /etc/systemd/sleep.conf.
  3. Charge the battery until it meets the threshold. Check that the battery is not charging with bat -s.
  4. sudo systemctl suspend-then-hibernate and wait for it to enter hibernate mode.
  5. Resume from hibernate. Check battery status with bat -s and it says it's charging.
  6. Run sudo bat -t 80 then check battery status. This time the threshold works and battery isn't charging.

Additional Notes

With both suspend and hibernate the threshold works properly.
I tried both 0.8 and 0.8.1, neither works.

System Info

OS: Manjaro Linux x86_64 
Host: ZenBook UX425EA_UX425EA 1.0 
Kernel: 5.13.8-1-MANJARO 
Packages: 1373 (pacman), 5 (flatpak), 10 (snap) 
Shell: zsh 5.8 
Resolution: 1920x1080 
DE: Plasma 5.22.4 
WM: KWin 
CPU: 11th Gen Intel i5-1135G7 (8) @ 4.200GHz 
GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics] 
Memory: 2203MiB / 15701MiB 

not working if the computer is put to sleep mode

If the laptop is put to suspend, then this feature doesn't work. Also, the persist function doesn't work.

And for example if I use the following command : ./bat --threshold 60, I get asked for root password, but I always get authentication failure. So, I need to use SUDO with it.

This program only works temporarily( During the session). If subjected to suspend or restart, then it fails.

I am using asus tuf a17 FA-706IH
operating system: ubuntu 20.04
kernel: 5.8.0-44-generic

issue: Could not find Bash on NixOS while setting persist mode

Subject of the issue

[igor@nixos:~]$ sudo bat -t 80
Charging threshold set.
Use sudo bat --persist to persist the setting between restarts.

[igor@nixos:~]$ sudo bat -p
Could not find Bash on your system.

NixOS uses Bash as default shell. Please, check your shell calls. Setting threshold works fine.

Your system

OS: NixOS 22.05 (Quokka) x86_64
Host: ASUSTeK COMPUTER INC. X513IA
Kernel: 5.15.43

Version

0.9 (Latest)

Steps to reproduce

No response

Expected behaviour

No response

Actual behaviour

No response

Authentication failure

When I execute the command below it returns "Authentication failure.":

./bat --threshold 60

The problem happens using root or sudo.

Works with T14 Gen2 Intel ThinkPads

Subject of the issue

Just wanted to add that the T14 Gen2 Intel version also works with this.

Your system

For example,

OS: Manjaro Linux x86_64
Host: 20W0003KUS ThinkPad T14 Gen 2i
Kernel: 5.15.12-1-MANJARO
CPU: Intel i5-1135G7 11th Gen

Version

0.8.4 (Latest)

Steps to reproduce

No response

Expected behaviour

No response

Actual behaviour

No response

Issues with hibernate

Discussed in https://github.com/leveson/bat/discussions/10

Originally posted by igor-frolikov July 25, 2021
bat 0.7
works fine after restart and return from suspend, but fails after return from hibernate. Resumes working fine after restart.
I tried install from github prebuilt images and from aur via pamac - no any difference.

OS: Manjaro Linux [x86_64]
Host: VivoBook_ASUSLaptop X513IA_M513IA 1.0
Kernel: 5.10.52-1-MANJARO
Packages: 1277 (pacman)[stable]
Shell: bash 5.1.8
DE: KDE Plasma 5.22.3
WM: KWin (X11)
CPU: AMD Ryzen 5 4500U with Radeon Graphics (6) @ 2.375GHz
GPU: AMD ATI Renoir
Memory: 1720MiB / 15484MiB (11%)
Disk (/): 12GB / 100GB (12%)
Battery: 90% [Not charging]

PS.
Thank you very much for your efforts!

issue: How to set charge resume level?

Hi,

This app is working nicely on an Asus M15 laptop running Fedora 34.

I have set the upper charge threshold at 60% and am wondering at what point charging will resume. One battery manager uses a low 30% figure for resuming charging and another uses 58%. Is there a way to adjust the resume charging level using bat?

BTW, the Fedora charging indicator correctly shows "Not Charging" when battery is above 60% charge.

Thanks.

exit status 1

I followed the instructions, but it doesn't seem to work. My laptop is Asus tuf A17 (fa706ih-au054t). I am getting this following message : "exit status 1". This is displayed for any command I run.

build: package bat for NixOS

Subject of the issue

Getting this error on NixOS when trying to make batter settings persist.

Running the command:
sudo /opt/asus-bat-manager/bin/bat persist --debug

gives this output.

open /etc/systemd/system/bat-hibernate.service: read-only file system

goroutine 1 [running]:
runtime/debug.Stack()
	/nix/store/ws97rhhdzacbl58y8crpvg517zqnbsll-go-1.21.5/share/go/src/runtime/debug/stack.go:24 +0x5e
main.main.func1()
	/home/kingbain/bat/main_linux.go:156 +0x55
panic({0x52f700?, 0xc00011ca50?})
	/nix/store/ws97rhhdzacbl58y8crpvg517zqnbsll-go-1.21.5/share/go/src/runtime/panic.go:920 +0x270
main.main()
	/home/kingbain/bat/main_linux.go:222 +0x1230

Any chance you could create a nixos package ?

issue: charge threshold not working after waking up from sleep

Subject of the issue

Charge threshold persistence not working after sleep

Your system

OS: Ubuntu 23.10 (mantic)
Host: Asus TUF A15 FA506IH
Kernel: 6.5.0-13-generic

Version

0.14 (Latest)

Steps to reproduce

  • set charge threshold
  • persist the charge threshold
  • send the host machine to sleep
  • wake up the machine

Expected behaviour

The persisted threshold should work

Actual behaviour

The charge threshold is not working at all unless set again

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.