Skip to content

Commit

Permalink
Hot-fix for laptops reporting wrong charing status (Close: #164)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdnanHodzic committed Feb 4, 2021
1 parent a4812ea commit bc601cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion auto_cpufreq/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
# 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
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions bin/auto-cpufreq
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit bc601cf

Please sign in to comment.