468 Commits

Author SHA1 Message Date
dementive
3f6d7a3e77
Refactor charging function ()
* Removed the `else` from the top level of the charging() function, the logic is the same but slightly easier to read now.

* Use os.path.exists() in the charging() function before opening the file instead of FileNotFoundError exceptions, makes the function a lot easier to read.

* Close the power_supply_type_path after reading the supply_type as it is not used later.

* Remove `else: continue` from the end of the charging() function for loop, this didn't actually do anything.

I tested the charging() function on my laptop plugged in and plugged out and it is still working as expected with these changes.
2024-05-25 17:09:54 +02:00
shadeyg56
487c344da3
Nix: fix duplicated package () 2024-05-25 17:02:57 +02:00
shadeyg56
a5ffa5730b Nix: add 'getent' package
Fixes 
2024-05-21 22:49:41 -05:00
Svenum
e878dd51fe
fix build () 2024-05-21 18:43:05 -05:00
shadeyg56
420648f5f1
Fix runit daemon deployment
Fixes 
2024-05-21 11:01:25 -05:00
dependabot[bot]
2b09bf7543
Bump requests from 2.31.0 to 2.32.0
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 17:13:07 +02:00
shadeyg56
1f911b534c batteries: use actual battery name instead of index 2024-05-14 17:46:51 -05:00
Angel
cc6d98d8b1
Minor refactor: code clean-up & make it more readable ()
* Clean code

* Back

* Clean code

* Back

* Clean code

* Change arch based detection
2024-05-12 16:16:40 +02:00
yezarniko
a79ec81709
critical name error in auto-cpufreq --stats () 2024-05-10 13:19:57 -05:00
parmjotsinghrobot
14e1d2785d
Change username for contributor ()
I forgot to update it here.
2024-05-10 08:05:40 +02:00
Angel
eb0ba8aa7e
Improve compatible for Arch based distributions ()
* Add dinit

* Add dinit

* Change arch based informations

* More compatible for Arch based distributions

* More compatible for Arch based distributions

* Clean code

* Clean code
2024-05-09 23:34:07 +02:00
Julia
b8f864e87e
Use Repology badge for automatic AUR version updating ()
https://repology.org/project/auto-cpufreq/badges
2024-05-09 21:54:50 +02:00
Angel
281a7adc34
Add dinit init system ()
* Add dinit support
2024-05-09 18:26:50 +02:00
Adnan Hodzic
78c3f71438 v2.3.0 release v2.3.0 2024-05-09 10:07:52 +02:00
PurpleWazard
95ba1f42bd
Add warnings for charge thresholds ()
* add warning messages to thinkpad

* added warnings to laptop_acpi

* added warnings to ideapad_laptop

* formatted the battery output and added stats to --debug and --status

* formated --stats better with battery info

* removed blank lines in battery info

* fixed typo: --stats battery info
2024-05-09 09:10:15 +02:00
Anshu Gahire
f1c1dc6b10
Fix spam error message when setting energy_performance_preference ()
* Fix spam error message when setting energy_performance_preference

The 'intel_pstate' driver does not allow the EPP to be set to anything
but 'performance' when the scaling governor is set to 'performance',
previously auto-cpufreq when the scaling-governor was set to
'performance' tried to set the EPP to 'balance-performance'
which caused a spam of write error messages in journalctl in system
with 'intel_pstate' drivers.
This is an intended behavior, since according to the [kernel documentation](https://docs.kernel.org/admin-guide/pm/intel_pstate.html#hwp-performance)
when HWP is enabled[(which is enabled by default during boot with supported processors)](https://docs.kernel.org/admin-guide/pm/intel_pstate.html#active-mode-with-hwp)
and scaling governor is set to performance the processor’s internal
P-state selection logic is expected to focus entirely on performance.
And this will override the EPP setting and reject any value different from 0 (“performance”).
This commit just changes the 'balance-performance' EPP preference in
set_performance() to 'performance'. Which fixes the spam issue.

* Only applies the spam error message fix for intel_pstate drivers

* Comparing the content of the file

intel_pstate/staus to make sure the condition only applies when "active"

* Override custom config EPP to "performance" for intel_pstate driver
2024-05-06 13:58:38 +02:00
shadeyg56
0815e7eb96
Rework config and reload config on file change/creation/deletion ()
* add config.py and config_event_handler.py
also introduces the utils folder

* update config imports and variables

* add 'pyinotify' dependency

* config: check for changes using threading

* config: handle errors and new eventsx

* config: set_path even if file doesn't exist and make new ConfigParser on every update

* fix get_config call

* config: check for changes on moved file

* call notifier.start() manually to prevent hanging

* config: update comments

* battery: fix config imports

* config: fix config deletion detection

* Add load from user config in XDG_CONFIG_HOME if available ()

* Add load from user config from in XDG_CONFIG_HOME if available

This update introduces the flexibility to load the configuration file from
multiple locations, prioritizing user preferences and system standards.
Previously, the configuration was strictly read from a hardcoded
system path (`/etc/auto-cpufreq.conf`). Now, the application first checks if the
user has specified a configuration file path via command line arguments. If not,
it looks for a configuration file in the user's config
directory (`$XDG_CONFIG_HOME/auto-cpufreq/auto-cpufreq.conf`). If neither is
found, it defaults to the original system-wide configuration file.

This allows users to add their auto-cpufreq configuration to their dotfiles.

* If --config is set but invalid, exit with error

* Remove redundant empty string check on config file path

* Remove duplicate isfile check for config path

See also: https://github.com/AdnanHodzic/auto-cpufreq/pull/672#discussion_r1548003119

* Update configuration options in README

See also: 

* config: move find_config_file function and fix finding home directory

* auto_cpufreq: fix hanging on --daemon, --live, and --monitor

* swap pyinotify for patched version

---------

Co-authored-by: Steven Braun <steven.braun.mz@gmail.com>
2024-04-30 08:35:53 +02:00
dependabot[bot]
8bb7478e38
Bump idna from 3.4 to 3.7 ()
Bumps [idna](https://github.com/kjd/idna) from 3.4 to 3.7.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](https://github.com/kjd/idna/compare/v3.4...v3.7)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 12:03:23 -05:00
shadeyg56
5e17ee31b1 update psutil to patched Git version
Fixes 
2024-04-09 23:57:05 -05:00
Donghee Na
2df634b09c
gh-667: Modify message when using amd-pstate-epp ()
* gh-667: Modify message when using amd-pstate-epp

* Address code review

* Address code review

* nit

* Update

* fix typo

---------

Co-authored-by: shadeyg56 <shadeyg56@gmail.com>
2024-04-09 14:28:56 -05:00
shadeyg56
215026ad43 battery: add shell=True to lsmod call
systemd needs shell=True otherwise it returns "FileNotFoundError: [Errno 2] No such file or directory: 'lsmod'"
2024-03-18 18:37:47 -05:00
PurpleWazard
971f40f0ca
Add conservation mode to lenovo laptops ()
* adding support for lenovo ideapad_laptop devices

* testing lenovo_laptop

* renamed functions

* fix code bugs

* updated readme with lenovo laptop conservation mode.
2024-03-11 07:09:26 +01:00
Parmjot
de12f9f708
README: update maintainer list for AUR package ()
Added myself and liljaylj, alongside MusicalArtist12, who was already there.

Also bumped the package version listed here.
2024-03-10 11:21:35 +01:00
shadeyg56
0354775b72
README: update badge links 2024-03-03 16:18:00 -06:00
shadeyg56
ab32952737
README: update badges to correct repo 2024-03-03 16:17:15 -06:00
shadeyg56
166cd065a2
Create workflows for Linux builds and Nix flake builds ()
* Create build-linux.yml

* Update build-linux.yml

* build-linux: run as sudo

* Create nix-build.yaml

* Rename nix-build.yaml to build-nix.yaml

* build-nix: rename workflow to 'Nix Flake'

* README: add workflow status badges
2024-03-03 12:25:43 +01:00
monarkjain
0354ff6cc4
Updated error handling to provide specific message for rate limit exceeded condition () 2024-02-25 19:40:04 -06:00
meator
b4c5276feb
Fix SyntaxWarning in objects.py ()
\( and \) are invalid escape sequences in Python. This can generate warnings.
2024-02-23 17:06:40 -06:00
dependabot[bot]
13e9009d5c
Bump cryptography from 42.0.2 to 42.0.4 ()
Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.2 to 42.0.4.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.2...42.0.4)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-22 19:39:20 +01:00
Adnan Hodzic
6ff1b89e22
Update README.md with battery thresholds config 2024-02-17 16:07:33 +01:00
dependabot[bot]
ba5b5fb032
Bump cryptography from 42.0.0 to 42.0.2 ()
Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.0 to 42.0.2.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.0...42.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-17 13:00:21 +01:00
Adnan Hodzic
7afd192ff9 v2.2.0 release v2.2.0 2024-02-14 17:47:37 +01:00
shadeyg56
9b8e873145
Update README with new battery thresholds feature ()
* README: add battery threshold sections

* README: link to version
2024-02-14 17:43:52 +01:00
PurpleWazard
1d7f12e846
added battery functions to --live () 2024-02-14 06:20:45 +01:00
PurpleWazard
539914a545
Rebuilt battery scripts ()
* rebuilt thinkpad and ideapad

* updated conf example
2024-02-13 19:34:11 +01:00
PurpleWazard
005b4aa178
enable_tresholds config file improvements (Closes: ) 2024-02-10 18:02:25 +01:00
dependabot[bot]
3e8ee20117
Bump cryptography from 41.0.6 to 42.0.0 ()
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.6 to 42.0.0.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.6...42.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 06:31:49 +01:00
PurpleWazard
1abad4da7b
Add battery charge thresholds limit ()
* added battery files

* finished main battery script

* added battery_script in auto_cpufreq

* fix some errors with batterys

* setup some battery stat printing

* added battery config printing to monitor and live modes

* fix some bugs now works on daemon and monitor mode

* cleaned up battery.py

* started to fix writing issue

* still debuging fixes

* bug fixed thinkpad stop threshold cant do below 65

* updated auto-cpufreq.conf-example with battery thresholds
2024-02-07 06:27:56 +01:00
PhoenixCausesOof
68dec52bce
Fix dynamic boosting being incorrectly diagnosed ()
* Fix dynamic boosting being incorrectly diagnosed

* Fix indentation

* Fix bool literal
2024-01-24 05:33:24 +01:00
Adnan Hodzic
e71edd8c30 Add ability to build snap for both amd64 & arm64 architecture 2024-01-21 15:24:57 +01:00
Lab Rat
27ca776029
Update README: add instruction for failing buildings in case of missing .git directory () 2024-01-21 15:22:46 +01:00
hingen
d2cb5a3761
Change check_for_update to not exit process on server connection error ()
Co-authored-by: hingen <1627313-hingen@users.noreply.gitlab.com>
2024-01-21 13:08:31 +01:00
Murray Gervais
fe29620646
Add support for configuring/overriding "Energy Performance Preference (EPP)" ()
* Added support for configuring/overriding energy performance preference (EPP)

* Corrected path to print available energy performance preferences in docs

* Added "EPP" wording to config examples

* Added message when EPP is not supported
2023-12-29 08:11:27 +01:00
Hugh O'Brien
8938cc92d7
Update nix flake instructions () 2023-12-17 15:44:48 -06:00
natewu
242cb0cb58
fix typo in dialog box () 2023-12-17 06:33:09 +01:00
avatar1024
c523f51fd1
Update README.md ()
Add another point in troubleshooting regarding turbo not available on some CPUs. This relates to https://github.com/AdnanHodzic/auto-cpufreq/issues/602 (workaround consisting in switching driver tested on AMD Zen 3+ and Zen 4 CPUs).
2023-12-10 07:57:14 +01:00
dependabot[bot]
cad325f265
Bump cryptography from 41.0.4 to 41.0.6 ()
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.4 to 41.0.6.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.4...41.0.6)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-10 07:36:22 +01:00
shadeyg56
4dbad5539a
nix: bump version to 2.1.0 and update lock file ()
* Update flake.lock

* nix: bump version to 2.1.0
2023-11-25 00:27:58 -06:00
Adnan Hodzic
0d1178cba0 Update snapcraft.yaml to pick up version from pyproject.toml 2023-11-22 06:40:28 +01:00
Julia
8b4ff4b443
Update README to match changes to the AUR package () 2023-11-22 06:22:13 +01:00