Commit Graph

14 Commits

Author SHA1 Message Date
shadeyg56 a14d06ce94
add shell=True to lsmod commnad
Fixes #740

Using shell=True is fine here because the shell command doesn't take in any user input
2024-07-29 15:01:00 -05:00
Angel 4ef561eccf
Show error message if threshold file doesn't exist (#742)
* Show error message if threshold file doesn't exist

* Repare stop threshold message

* Repare check_output error
2024-07-18 20:02:59 +02:00
Angel 6f7e469e66
Code refactoring, more readable and easier to modify (#736)
* Add global variables

* Add global variables

* Code refactoring

* Refactoring
2024-07-16 16:37:04 +02:00
Angel a7df94d832
Fix #715, #713, #634 issues (#716)
* Remove | in type

* Repare battery read problem

* Compatible with many arguments
2024-06-07 18:47:01 +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 (#695)
* 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 (#696) 2024-05-10 13:19:57 -05:00
PurpleWazard 95ba1f42bd
Add warnings for charge thresholds (#679)
* 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
shadeyg56 0815e7eb96
Rework config and reload config on file change/creation/deletion (#663)
* 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 (#672)

* 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: #672

* 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
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 (#652)
* 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
PurpleWazard 539914a545
Rebuilt battery scripts (#645)
* rebuilt thinkpad and ideapad

* updated conf example
2024-02-13 19:34:11 +01:00
PurpleWazard 005b4aa178
enable_tresholds config file improvements (Closes: #641) 2024-02-10 18:02:25 +01:00
PurpleWazard 1abad4da7b
Add battery charge thresholds limit (#637)
* 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