mirror of
https://github.com/onyx-and-iris/nvda-addon-voicemeeter.git
synced 2024-11-15 15:00:47 +00:00
onyx-and-iris
bfccc323f1
config.py added. loads custom user settings _make_gestures moved into util.py
21 lines
397 B
Python
21 lines
397 B
Python
import json
|
|
from pathlib import Path
|
|
|
|
|
|
def config_from_json():
|
|
pn = Path.home() / "Documents" / "Voicemeeter" / "nvda_settings.json"
|
|
data = None
|
|
if pn.exists():
|
|
with open(pn, "r") as f:
|
|
data = json.load(f)
|
|
return data or {}
|
|
|
|
|
|
__config = config_from_json()
|
|
|
|
|
|
def get(name, default=None):
|
|
if name in __config:
|
|
return __config[name]
|
|
return default
|