* 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.
* Add dinit
* Add dinit
* Change arch based informations
* More compatible for Arch based distributions
* More compatible for Arch based distributions
* Clean code
* Clean code
* 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
* 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
* 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>
* 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