feat(config): wire up wallpapers_dir, osd, window_switcher, global_menu settings

- wallpapers_dir: read from config, fallback ~/Pictures/Wallpapers
- osd: skip show_audio_osd/show_brightness_osd when disabled
- window_switcher: skip show_switcher when disabled
- global_menu_cache_enabled: bypass GTK class cache when false
- global_menu_method: control discovery strategies (auto/hyprland/dbus)

All keys added to constants.py defaults, settings UI, and config.toml
This commit is contained in:
sankalp committed 2026-07-15 10:31:28 +05:45
1 parent e63a2c04a5
commit 9eb62d7ea3
7 files changed
+148 -55

No files matched your search

+12 -5
View File
@@ -222,9 +222,15 @@ def executable_gtk_class(executable: str | None) -> str | None:
cache = _load_cache()
key = f"{path}"
cached = cache.get(key)
if cached and cached.get("mtime") == mtime:
return cached.get("class")
from services.config import get_config
use_cache = get_config("global_menu_cache_enabled", True)
if use_cache:
cached = cache.get(key)
if cached and cached.get("mtime") == mtime:
return cached.get("class")
needed = _transitive_needed(path)
if GTK4_SONAME in needed:
@@ -234,6 +240,7 @@ def executable_gtk_class(executable: str | None) -> str | None:
else:
klass = None
cache[key] = {"mtime": mtime, "class": klass}
_save_cache(cache)
if use_cache:
cache[key] = {"mtime": mtime, "class": klass}
_save_cache(cache)
return klass
+14 -5
View File
@@ -619,11 +619,20 @@ class GlobalMenuService(Service):
if target_pid <= 0:
return None
strategies = [
self._find_registry,
self._find_registrar,
self._find_fallback_scan,
]
from services.config import get_config
method = get_config("global_menu_method", "hyprland")
strategies = []
if method in ("hyprland", "auto"):
strategies.extend(
[
self._find_registry,
self._find_registrar,
]
)
if method in ("dbus", "auto"):
strategies.append(self._find_fallback_scan)
for strategy in strategies:
result = strategy(wm_class, target_pid)