Commit Graph

9 Commits

Author SHA1 Message Date
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
dependabot[bot] 8bb7478e38
Bump idna from 3.4 to 3.7 (#678)
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 #654
2024-04-09 23:57:05 -05:00
dependabot[bot] 13e9009d5c
Bump cryptography from 42.0.2 to 42.0.4 (#653)
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
dependabot[bot] ba5b5fb032
Bump cryptography from 42.0.0 to 42.0.2 (#648)
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
dependabot[bot] 3e8ee20117
Bump cryptography from 41.0.6 to 42.0.0 (#638)
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
dependabot[bot] cad325f265
Bump cryptography from 41.0.4 to 41.0.6 (#610)
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
dependabot[bot] 3414f4878a
Bump urllib3 from 2.0.6 to 2.0.7
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.0.6...2.0.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-17 21:12:32 +00:00
Lab Rat 37e12a4266
Support for pyproject.toml (#576)
* feat: support for pyproject.toml

* Nix: Fix package to work with pyproject.toml

---------

Co-authored-by: shadeyg56 <shadeyg56@gmail.com>
2023-10-13 08:04:49 +02:00