refactor(services): convert weather + gamemode to Fabric services
Weather: move networking, caching and scheduling out of the Weather widget into a WeatherService singleton. Reuse one httpx.Client for the app lifetime, drop the 4-worker pool and the multi-entry dict caches (single-value fields), query Nominatim only on location change, remove debounce and the /tmp-style polling. Widget now observes the `updated` signal and never hits the network. GameMode: turn the standalone CLI script into a GameModeService (Service singleton) exposing an `enabled` Property and `changed` signal. Drive Hyprland via `hyprctl eval hl.config(...)` instead of the deprecated `hyprctl keyword` batch (rejected under the Lua config in Hyprland 0.55+), read state via `hl.get_config`, and keep `hyprctl reload` for disable. Fix game-mode state parsing so unrecognized `hl.get_config` output no longer falsely reports active. BatteryWidget's GameModeButton now subscribes to the service. Remove now-unused LOCATION_CACHE_TIMEOUT.
This commit is contained in:
4 files changed
+280
-321
No files matched your search
@@ -14,7 +14,6 @@ CALENDAR_UPDATE_INTERVAL = int(
|
||||
)
|
||||
* 1000
|
||||
) # Calculate time till midnight
|
||||
LOCATION_CACHE_TIMEOUT = 604800 # 7 days (extended from 24h)
|
||||
|
||||
|
||||
WEATHER_GRADIENT_MAP = {
|
||||
|
||||
Reference in new issue
Block a user