From b29221fd0d19ee1e49e4e1744abc2981f0174853 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 1 Dec 2025 11:12:41 +0200 Subject: fix: Fix wallpaper selector showing wrong wallpaper when filename contains dots The `cut -d. -f1` command truncated filenames at the first dot, causing wallpapers named like "01. Catppuccin.jpg" to display as just "01" in the rofi menu. Multiple wallpapers with the same prefix showed identical labels, and selecting one applied the wrong file since `find -print -quit` returned the first alphabetical match. Changed to use full filename `$pic_name` (consistent with GIF and video handling on lines 87 and 94). The existing sed on line 222 correctly strips only the file extension for the find command. --- config/hypr/UserScripts/WallpaperSelect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index 9e51125f..0029d3e5 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -93,7 +93,7 @@ menu() { fi printf "%s\x00icon\x1f%s\n" "$pic_name" "$cache_preview_image" else - printf "%s\x00icon\x1f%s\n" "$(echo "$pic_name" | cut -d. -f1)" "$pic_path" + printf "%s\x00icon\x1f%s\n" "$pic_name" "$pic_path" fi done } -- cgit v1.2.3 From d3f0b79867deb344c03d50599e589b0a6e9a46f4 Mon Sep 17 00:00:00 2001 From: Alberson Miranda Date: Fri, 5 Dec 2025 13:27:03 -0300 Subject: fix: Check for empty strings in place parts and prevent coordinates from printing when a place is found. --- config/hypr/UserScripts/Weather.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/Weather.py b/config/hypr/UserScripts/Weather.py index a9a826e1..7da48f1e 100755 --- a/config/hypr/UserScripts/Weather.py +++ b/config/hypr/UserScripts/Weather.py @@ -455,15 +455,15 @@ def fetch_aqi(lat: float, lon: float) -> Optional[Dict[str, Any]]: def extract_place_parts_nominatim(data_dict: JSONDict) -> List[str]: address = ensure_dict(data_dict.get("address")) candidates = [data_dict.get("name"), address.get("city"), address.get("town"), address.get("village"), address.get("hamlet")] - name = cast(Optional[str], next((c for c in candidates if c is not None), None)) + name = cast(Optional[str], next((c for c in candidates if c is not None and c != ""), None)) admin1 = cast(Optional[str], address.get("state")) country = cast(Optional[str], address.get("country")) parts: List[str] = [] - if name is not None: + if name is not None and name != "": parts.append(name) - if admin1 is not None: + if admin1 is not None and admin1 != "": parts.append(admin1) - if country is not None: + if country is not None and country != "": parts.append(country) return parts @@ -691,7 +691,7 @@ def build_aqi_info(aqi: Optional[Dict[str, Any]]) -> str: def build_place_str(lat: float, lon: float, place: Optional[str]) -> str: effective_place = MANUAL_PLACE or ENV_PLACE or place if effective_place: - return f"{effective_place} ({lat:.3f}, {lon:.3f})" + return effective_place return f"{lat:.3f}, {lon:.3f}" -- cgit v1.2.3 From 75d256e3ce56abce1754c5182e61cdf6b50c3661 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 6 Dec 2025 12:46:37 -0500 Subject: Invalidate cache when changing units On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: Weather.py --- config/hypr/UserScripts/Weather.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/Weather.py b/config/hypr/UserScripts/Weather.py index 14256cfd..6061f696 100755 --- a/config/hypr/UserScripts/Weather.py +++ b/config/hypr/UserScripts/Weather.py @@ -224,6 +224,12 @@ def read_api_cache() -> Optional[Dict[str, Any]]: data = json.load(f) # Use ensure_dict for safety data_dict = ensure_dict(data) + + # Invalidate cache if units mismatch + if data_dict.get("units") != UNITS: + log_debug(f"Cache units '{data_dict.get('units')}' mismatch current '{UNITS}'.") + return None + timestamp_val = data_dict.get("timestamp", 0) timestamp = coerce_float(timestamp_val) or 0 if (time.time() - timestamp) <= CACHE_TTL_SECONDS: @@ -238,6 +244,7 @@ def write_api_cache(payload: Dict[str, Any]) -> None: try: ensure_cache_dir() payload["timestamp"] = time.time() + payload["units"] = UNITS with API_CACHE_PATH.open("w", encoding="utf-8") as f: json.dump(payload, f) except Exception as e: -- cgit v1.2.3