rickysarraf / laptop-mode-tools

Power Savings tool for Linux
https://www.researchut.com/tags/laptop-mode-tools/
GNU General Public License v2.0
553 stars 47 forks source link

USB-C power supply might not be reported #191

Open rwappler opened 1 year ago

rwappler commented 1 year ago

Describe the bug I am sitting here on a Thinkpad T14 AMD Gen 2a. The power supply is connected via USB-C. However, kernel does not report it as USB-Device or power delivery. Therefore /sys/class/power_supply/*/online will never be 1. Therefore laptop-mode will always be active.

Fix suggested in https://github.com/rickysarraf/laptop-mode-tools/pull/192

To Reproduce Steps to reproduce the behavior:

  1. Use power supply via USB-C that is not detected by the kernel
  2. run laptop_mode status
  3. laptop-mode will always be active.

Expected behavior

In absence of an AC power supply, the battery status should be used, to determine, whether to activate laptop-mode or not. I.e. activate it based on BATTERY_NOT_DISCHARGING

Screenshots n/a

Important Information:

Additional context Add any other context about the problem here.