Fix: always use XDG config path, drop script_dir fallback; bump to v0.3.0
parent
c3a7ea811e
commit
14ff10e959
2
PKGBUILD
2
PKGBUILD
|
|
@ -1,7 +1,7 @@
|
||||||
# Maintainer: Sean Doran <sdoran35@gmail.com>
|
# Maintainer: Sean Doran <sdoran35@gmail.com>
|
||||||
# AUR updates are automated via GitHub Actions on version tag push
|
# AUR updates are automated via GitHub Actions on version tag push
|
||||||
pkgname=turn-up-arch
|
pkgname=turn-up-arch
|
||||||
pkgver=0.2.9
|
pkgver=0.3.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="USB serial knob/button mixer daemon for PipeWire/PulseAudio on Linux"
|
pkgdesc="USB serial knob/button mixer daemon for PipeWire/PulseAudio on Linux"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "turnup"
|
name = "turnup"
|
||||||
version = "0.2.9"
|
version = "0.3.0"
|
||||||
description = "USB serial knob/button mixer daemon for PipeWire/PulseAudio on Linux"
|
description = "USB serial knob/button mixer daemon for PipeWire/PulseAudio on Linux"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = { text = "MIT" }
|
license = { text = "MIT" }
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
"""Turn Up — USB serial mixer daemon for PipeWire/PulseAudio."""
|
"""Turn Up — USB serial mixer daemon for PipeWire/PulseAudio."""
|
||||||
|
|
||||||
__version__ = "0.2.9"
|
__version__ = "0.3.0"
|
||||||
|
|
|
||||||
|
|
@ -160,18 +160,13 @@ def load_config(path: str | None = None) -> dict:
|
||||||
"""Load configuration from *path*.
|
"""Load configuration from *path*.
|
||||||
|
|
||||||
If *path* is ``None`` the XDG-compliant location
|
If *path* is ``None`` the XDG-compliant location
|
||||||
``~/.config/turnup/config.json`` is used, falling back to the directory
|
``~/.config/turnup/config.json`` is used.
|
||||||
that contains this module for backwards compatibility.
|
|
||||||
|
|
||||||
Returns the parsed and validated configuration dictionary.
|
Returns the parsed and validated configuration dictionary.
|
||||||
Exits with status 1 on malformed JSON.
|
Exits with status 1 on malformed JSON.
|
||||||
"""
|
"""
|
||||||
if path is None:
|
if path is None:
|
||||||
if os.path.exists(DEFAULT_CONFIG_PATH):
|
|
||||||
path = DEFAULT_CONFIG_PATH
|
path = DEFAULT_CONFIG_PATH
|
||||||
else:
|
|
||||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
path = os.path.join(script_dir, "config.json")
|
|
||||||
|
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
log.warning("No config.json found at %s — writing defaults", path)
|
log.warning("No config.json found at %s — writing defaults", path)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue