From b46e3a6ffc2036cf6ede76bc0a6d7d39ee7b3c54 Mon Sep 17 00:00:00 2001 From: Angel-Karasu Date: Wed, 31 Jul 2024 13:14:08 +0200 Subject: [PATCH] Fixed the error when using the only --config-reload --- auto_cpufreq/bin/auto_cpufreq.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/auto_cpufreq/bin/auto_cpufreq.py b/auto_cpufreq/bin/auto_cpufreq.py index f05e79f..42022d8 100755 --- a/auto_cpufreq/bin/auto_cpufreq.py +++ b/auto_cpufreq/bin/auto_cpufreq.py @@ -23,7 +23,7 @@ from auto_cpufreq.power_helper import * @click.option("--remove", is_flag=True, help="Remove daemon for (permanent) automatic CPU optimizations") @click.option("--force", is_flag=False, help="Force use of either \"powersave\" or \"performance\" governors. Setting to \"reset\" will go back to normal mode") @click.option("--config", is_flag=False, required=False, help="Use config file at defined path") -@click.option("--config-reload", is_flag=True, help="Reload auto-cpufreq daemon to pick up changes made in auto-cpufreq config file") +@click.option("--config-reload", is_flag=True, help="Reload auto-cpufreq daemon|monitor|live to pick up changes made in auto-cpufreq config file") @click.option("--stats", is_flag=True, help="View live stats of CPU optimizations made by daemon") @click.option("--get-state", is_flag=True, hidden=True) @click.option("--completions", is_flag=False, help="Enables shell completions for bash, zsh and fish.\n Possible values bash|zsh|fish") @@ -31,8 +31,6 @@ from auto_cpufreq.power_helper import * @click.option("--version", is_flag=True, help="Show currently installed version") @click.option("--donate", is_flag=True, help="Support the project") def main(monitor, live, daemon, install, update, remove, force, config, reload, stats, get_state, completions, debug, version, donate): - CONFIG.setup(config, reload) - if len(sys.argv) == 1: print("\n" + "-" * 32 + " auto-cpufreq " + "-" * 33 + "\n") print("Automatic CPU speed & power optimizer for Linux") @@ -52,6 +50,7 @@ def main(monitor, live, daemon, install, update, remove, force, config, reload, if monitor: root_check() print('\nNote: You can quit monitor mode by pressing "ctrl+c"') + CONFIG.setup(config, reload) battery_setup() battery_get_thresholds() if IS_INSTALLED_WITH_SNAP: @@ -76,6 +75,7 @@ def main(monitor, live, daemon, install, update, remove, force, config, reload, elif live: root_check() print('\nNote: You can quit live mode by pressing "ctrl+c"') + CONFIG.setup(config, reload) time.sleep(1) battery_setup() battery_get_thresholds() @@ -103,6 +103,7 @@ def main(monitor, live, daemon, install, update, remove, force, config, reload, CONFIG.stop_notifier() elif daemon: root_check() + CONFIG.setup(config, reload) file_stats() if IS_INSTALLED_WITH_SNAP and dcheck == "enabled": gnome_power_detect_snap()