0

I have a ASUS laptop -> Asus TUF A15 . I want to set the laptop to use AC source for power once it charges to a threshold of 70%. In Windows I have the option to do this.

Upon a google search I found an answer . Go I go to the location --> /sys/class/power_supply/BAT1/charge_control_end_threshold --> Tried to edit and save it by setting it to 70. But it doesn't work.

Any idea how I can do this?

  • When you say "it doesn't work" do you mean "I have the file and can edit it, but the battery charges beyond 70%" or do you mean "The file exists, but I cannot edit it" or do you mean "The file does not exist at all"? The contents of the /sys/class/power_supply directory can vary from machine to machine — even if using the same model — due to BIOS settings and/or battery manufacturers ... –  Feb 07 '21 at 04:57
  • I edited the file . But when I save it, I get the following error :

    `/sys/class/power_supply/BAT1$ sudo gedit charge_control_end_threshold

    (gedit:75368): Tepl-WARNING **: 10:30:13.061: GVfs metadata is not supported. Fallback to TeplMetadataManager. Either GVfs is not correctly installed or GVfs metadata are not supported on this platform. In the latter case, you should configure Tepl with --disable-gvfs-metadata.`

    – harikrishnan Feb 07 '21 at 05:01
  • 1
    Including error messages when asking for technical help will usually make it easier for others to offer assistance. Fortunately, the warning that you're seeing here is a non-issue. Generally, it's best to not use sudo with Gnome applications but, instead, the admin:// schema. For example: gedit admin:///sys/class/power_supply/BAT1/charge_control_end_threshold. Either way, BAT0 is what you reported in the question, BAT1 is in your comment. Inconsistencies make things harder to solve. Please update your question to include the directory listing for /sys/class/power_supply/BAT1 –  Feb 07 '21 at 05:12
  • 1
    Nowhere it say's that you have to edit that file ... just echo the value into it. /sys is not a real filesystem, but an interface to see and set parameters in the kernel. But what is wrong with the defaults ? Doesn't your ASUS use AC when connected ? – Soren A Feb 07 '21 at 05:19
  • My bad , thank you for informing me about these. Haven't heard of admin:// before. I'll try the echo method and report back – harikrishnan Feb 07 '21 at 05:46
  • Yep , I tried to echo it through terminal and it works. I did not notice that "BAT0" was different from whats in my system "BAT1" . I had copy pasted previously from the answer . It now works. Thank you.

    Also , I would like to learn what exactly does "echo" do ? Does it pass values to the config in this case?

    – harikrishnan Feb 07 '21 at 05:53

0 Answers0