Hot-fix for laptops reporting wrong charing status (Close: #164)

This commit is contained in:
Adnan Hodzic 2021-02-04 08:06:41 +01:00
parent a4812ea920
commit 3985d3ef5a
3 changed files with 6 additions and 2 deletions

View File

@ -119,7 +119,7 @@ def charging():
computer_type = getoutput('dmidecode --string chassis-type')
if computer_type == "Notebook":
if computer_type == "Notebook" or "Laptop" or "Convertible" or "Portable":
# AC adapter states: 0, 1, unknown
ac_info = getoutput(f"grep . {power_dir}A*/online").splitlines()
# if there's one ac-adapter on-line, ac_state is True
@ -662,6 +662,9 @@ def python_info():
#print("distro:", distro.__version__)
run("echo \"distro package\" $(pip3 show distro | sed -n -e 's/^.*Version: //p')", shell=True)
def device_info():
print("Computer type", getoutput('dmidecode --string chassis-type'))
def distro_info():
dist = "UNKNOWN distro"

View File

@ -95,6 +95,7 @@ def main(monitor, live, install, stats, log, daemon, debug):
print("")
python_info()
print("")
device_info()
if charging():
print("Battery is: charging")
else:

View File

@ -1,6 +1,6 @@
name: auto-cpufreq
base: core20
version: '1.5.4'
version: '1.5.5'
summary: Automatic CPU speed & power optimizer for Linux
description: |
Automatic CPU speed & power optimizer for Linux based on active