3

I have Asus VivoBook Pro 15 with Ubuntu 18.04 LTS. I have a problem with the battery threshold setting, say 80%.

I saw TLP solutions - they are available for ThinkPad Laptops and "laptop-mode-tools" - I did not find a battery threshold solution here.

Maybe you have other solutions?

Webdev
  • 51
  • 4
  • Kinda hacky workaround, you can [enable an alert asking you disconnect the AC adapter manually after the battery level crosses 80%](https://askubuntu.com/q/1157608/480481). – pomsky Aug 06 '19 at 10:06
  • @pomsky Thanks for the answer. I was more concerned about the possibility of working non-stop with a laptop connected to electricity and a battery charged up to 80%. Here the solution is with notification that at 90% I can disconnect the cable, and I do not want to do it... – Webdev Aug 06 '19 at 10:48

1 Answers1

2

I wrote a command line application that does this.

The easiest way to get started is download the app from the releases page and run

$ ./bat --help

from the terminal in the directory where it is located which should show the help documentation.

If there's an error, it might have to do with permissions. The following command might solve the problem.

chmod +x ./bat

Basically, running

$ ./bat --threshold

will print out the current threshold.

To set a new threshold, say 60%, run

./bat --threshold 60

To persist the current threshold between restarts, run

sudo ./bat --persist

Note: Persisting uses systemd under the hood but this is bundled with most Linux distributions including Ubuntu.

Tip: Putting the app in a directory like /usr/local/bin/ that is in the $PATH will enable you to run it from anywhere and not just in the directory the app is in. Then the above commands become,

bat --help
bat --threshold 60
bat --persist

respectively.