Hot-fix for laptops reporting wrong charing status (Close: #164)
This commit is contained in:
parent
a4812ea920
commit
3985d3ef5a
|
@ -119,7 +119,7 @@ def charging():
|
||||||
|
|
||||||
computer_type = getoutput('dmidecode --string chassis-type')
|
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 adapter states: 0, 1, unknown
|
||||||
ac_info = getoutput(f"grep . {power_dir}A*/online").splitlines()
|
ac_info = getoutput(f"grep . {power_dir}A*/online").splitlines()
|
||||||
# if there's one ac-adapter on-line, ac_state is True
|
# if there's one ac-adapter on-line, ac_state is True
|
||||||
|
@ -662,6 +662,9 @@ def python_info():
|
||||||
#print("distro:", distro.__version__)
|
#print("distro:", distro.__version__)
|
||||||
run("echo \"distro package\" $(pip3 show distro | sed -n -e 's/^.*Version: //p')", shell=True)
|
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():
|
def distro_info():
|
||||||
dist = "UNKNOWN distro"
|
dist = "UNKNOWN distro"
|
||||||
|
|
|
@ -95,6 +95,7 @@ def main(monitor, live, install, stats, log, daemon, debug):
|
||||||
print("")
|
print("")
|
||||||
python_info()
|
python_info()
|
||||||
print("")
|
print("")
|
||||||
|
device_info()
|
||||||
if charging():
|
if charging():
|
||||||
print("Battery is: charging")
|
print("Battery is: charging")
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: auto-cpufreq
|
name: auto-cpufreq
|
||||||
base: core20
|
base: core20
|
||||||
version: '1.5.4'
|
version: '1.5.5'
|
||||||
summary: Automatic CPU speed & power optimizer for Linux
|
summary: Automatic CPU speed & power optimizer for Linux
|
||||||
description: |
|
description: |
|
||||||
Automatic CPU speed & power optimizer for Linux based on active
|
Automatic CPU speed & power optimizer for Linux based on active
|
||||||
|
|
Loading…
Reference in New Issue