From cb00de36f0f70534bfac7c118550171e2f8327ba Mon Sep 17 00:00:00 2001 From: Onyx and Iris Date: Wed, 22 Jan 2025 16:30:06 +0000 Subject: [PATCH] add _internal/configs to config paths. vm-compact dirs now override _internal/config upd README TOML Files section --- README.md | 20 ++++++++++++-------- vmcompact/configurations.py | 14 +++++++------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 012f26e..bb37b19 100644 --- a/README.md +++ b/README.md @@ -65,15 +65,18 @@ Set the kind of Voicemeeter, KIND_ID may be: ## TOML Files -This is how your files should be organised. Wherever your `__main__.py` file is located (after install this can be any location), `configs` should be in the same location. -Directly inside of configs directory you may place an app.toml, vban.toml and a directory for each kind. -Inside each kind directory you may place as many custom toml configurations as you wish. +If you've downloaded the binary from [Releases][releases] you can find configs included in the `_internal/configs` directory. + +You may override these configs by placing a directory `vm-compact` in one of the following locations: + +- `user home directory / .config` +- `user home directory / Documents / Voicemeeter` + +The contents should match the following directory structure: . -├── `__main__.py` - -├── configs +├── vm-compact         ├── app.toml @@ -111,7 +114,7 @@ Configure certain startup states for the app. Configure a user config to load on app startup. Don't include the .toml extension in the config name. - `theme` - By default the app loads up the [Sun Valley light or dark theme][def] by @rdbende. You have the option to load up the app without any theme loaded. Simply set `enabled` to false and `mode` will take no effect. + By default the app loads up the [Sun Valley light or dark theme][releases] by @rdbende. You have the option to load up the app without any theme loaded. Simply set `enabled` to false and `mode` will take no effect. - `extends` Extending the app will show both strips and buses. In reduced mode only one or the other. This app will extend both horizontally and vertically, simply set `extends_horizontal` true or false accordingly. @@ -164,4 +167,5 @@ User configs may be loaded at any time via the menu. [Rdbende](https://github.com/rdbende) for creating the beautiful [Sun Valley theme][sv-theme]. -[sv-theme]: https://github.com/rdbende/Sun-Valley-ttk-theme \ No newline at end of file +[sv-theme]: https://github.com/rdbende/Sun-Valley-ttk-theme +[releases]: https://github.com/onyx-and-iris/voicemeeter-compact/releases \ No newline at end of file diff --git a/vmcompact/configurations.py b/vmcompact/configurations.py index 2c199dc..1dbe734 100644 --- a/vmcompact/configurations.py +++ b/vmcompact/configurations.py @@ -12,14 +12,14 @@ configuration = {} def get_configpath(): - configpaths = [ + for pn in ( + Path.home() / '.config' / 'vm-compact', + Path.home() / 'Documents' / 'Voicemeeter' / 'vm-compact', + Path.cwd() / '_internal' / 'configs', Path.cwd() / 'configs', - Path.home() / '.config' / 'vm-compact' / 'configs', - Path.home() / 'Documents' / 'Voicemeeter' / 'configs', - ] - for configpath in configpaths: - if configpath.exists(): - return configpath + ): + if pn.exists(): + return pn if configpath := get_configpath():