1. 19
  1.  

  2. 3

    is it possible to ‘programmatically’ control the power-supply ?

    if it is, then it would/should be quite trivial to connect/disconnect the power-supply, based on current battery charge f.e. when battery is charged to 90% disconnect the power-supply. and when the charge drops to approx say, 15% .. 20% range, resume charging once again…

    1. 10

      Yes… just did this yesterday…. you can set start and stop charge levels (in percentage) in the files:

      • /sys/class/power_supply/BAT0/charge_start_threshold 50
      • /sys/class/power_supply/BAT0/charge_stop_threshold 80
      • /sys/class/power_supply/BAT1/charge_start_threshold 50
      • /sys/class/power_supply/BAT1/charge_stop_threshold 80

      I’ve set them to 50 and 80 respectively…. so my charger will only start charging when the battery-level drops below 50% and stop again when reaching 80%. This will also make your battery degrade slower.

      if you need a full charge, for example, when expecting to be on the road all day, set the thresholds back to 0 and 100 a day/a few hours before

      (Edit: formatting)

      1. 4

        The hardware has to support it.

        1. 2

          lovely ! that’s exactly what i was looking for. thanks !

      2. 1

        I never use hibernate, as suspend-to-ram will keep my system suspended for days with only a very low battery-usage, and hibernating just takes too long to start/stop. It does mean I occasionally run completely out of battery, but this only happens vary occasionally, usually just when the suspend failed, and the system remained on in my bag. With 32GB of ram, I don’t want to have a 32G swap/suspend partition, waste of space, and it just takes to long.

        1. 1

          With 32GB of ram, I don’t want to have a 32G swap/suspend partition, waste of space, and it just takes to long.

          It won’t address your ‘takes too long’ comment, but I’m surprised there is no compression support for the image written to disk during hibernate..