From 4a9a1ec799842d35f44d89fd26ca64ff4bef20b6 Mon Sep 17 00:00:00 2001 From: Christian Kauer Date: Wed, 25 Mar 2026 16:24:18 +0100 Subject: [PATCH] fix dict path --- .claude/settings.local.json | 5 ++++- shared_data/vocabulary.json | 4 ++++ whisper_app/config.py | 7 ++++++- whisper_app/vocab_window.py | 10 +++++----- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 6d4abb0..44d0c11 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -92,7 +92,10 @@ "Bash(ydotool type:*)", "Bash(wl-copy -- \"XDOTOOL_TEST\")", "Bash(xdotool key:*)", - "Bash(find /mnt/ventoy/projects/chrka/whisper-dictation/shared_data/ -name *.bin -o -name *.pt -o -name model*)" + "Bash(find /mnt/ventoy/projects/chrka/whisper-dictation/shared_data/ -name *.bin -o -name *.pt -o -name model*)", + "Bash(python3 -c \":*)", + "Read(//usr/bin/**)", + "Bash(/run/media/chk/Ventoy/projects/chrka/whisper-dictation/.venv-linux/bin/python build.py)" ] } } diff --git a/shared_data/vocabulary.json b/shared_data/vocabulary.json index 912b68e..995ac8c 100644 --- a/shared_data/vocabulary.json +++ b/shared_data/vocabulary.json @@ -66,6 +66,10 @@ { "from": "SHP", "to": "SAP" + }, + { + "from": "GRA App", + "to": "KRAH-App" } ] } \ No newline at end of file diff --git a/whisper_app/config.py b/whisper_app/config.py index e509cd8..d5ce13a 100644 --- a/whisper_app/config.py +++ b/whisper_app/config.py @@ -6,7 +6,12 @@ import sys def _app_dir() -> str: """Root dir for config.json and vocabulary.json.""" if getattr(sys, "frozen", False): - return os.path.dirname(sys.executable) + exe_dir = os.path.dirname(sys.executable) + # Built exe lives at dist//; project root is two levels up. + project_root = os.path.normpath(os.path.join(exe_dir, "..", "..")) + if os.path.isfile(os.path.join(project_root, "config.json")): + return project_root + return exe_dir # config.py lives at whisper_app/config.py → parent of parent = repo root return os.path.dirname(os.path.dirname(os.path.abspath(__file__))) diff --git a/whisper_app/vocab_window.py b/whisper_app/vocab_window.py index aafac0e..b7d40fa 100644 --- a/whisper_app/vocab_window.py +++ b/whisper_app/vocab_window.py @@ -31,8 +31,8 @@ def _open_main(root: tk.Tk) -> None: win.title("Vokabular") win.configure(bg=BG) win.attributes("-topmost", True) - win.resizable(False, False) - win.minsize(600, 0) + win.resizable(True, True) + win.minsize(600, 480) win.option_add("*Menu.background", BG3) win.option_add("*Menu.foreground", FG) win.option_add("*Menu.activeBackground", AMBER) @@ -192,6 +192,6 @@ def _open_main(root: tk.Tk) -> None: win.update_idletasks() sw = win.winfo_screenwidth() sh = win.winfo_screenheight() - w = win.winfo_reqwidth() - h = win.winfo_reqheight() - win.geometry(f"+{(sw-w)//2}+{(sh-h)//2}") + w = max(win.winfo_reqwidth(), 600) + h = min(max(win.winfo_reqheight(), 480), sh - 100) + win.geometry(f"{w}x{h}+{(sw-w)//2}+{(sh-h)//2}")