aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/eww/workspaces.py
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-27 00:48:09 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-29 03:50:30 +0530
commit26022cdaba2e3e542adcfd9570de3b04b6bc8541 (patch)
tree77045480173725f8082e6f6e19cf8457569c8865 /modules/desktop/eww/workspaces.py
parentc306d53594a6cefc2ecc39dd8d29f9edf1b8ed77 (diff)
downloadhome-manager-config-26022cdaba2e3e542adcfd9570de3b04b6bc8541.tar.gz
home-manager-config-26022cdaba2e3e542adcfd9570de3b04b6bc8541.zip
desktop: added an actual unknown window icon, fixed the scripts crashing
- using a question mark svg as the icon for unknown windows - the activate-windows and workspaces scripts encountered crashes when trying to get the icon, fixed it
Diffstat (limited to 'modules/desktop/eww/workspaces.py')
-rw-r--r--modules/desktop/eww/workspaces.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/desktop/eww/workspaces.py b/modules/desktop/eww/workspaces.py
index b8fae1b..d8e774b 100644
--- a/modules/desktop/eww/workspaces.py
+++ b/modules/desktop/eww/workspaces.py
@@ -11,14 +11,21 @@ icon_theme = Gtk.IconTheme.get_default()
_icon_cache: dict[str, str] = {}
+def try_desktop_app_info(desktop_id: str):
+ try:
+ return Gio.DesktopAppInfo.new(desktop_id)
+ except TypeError:
+ return None
+
+
def resolve_icon_path(app_id: str) -> str:
if not app_id:
return ""
if app_id in _icon_cache:
return _icon_cache[app_id]
- app_info = Gio.DesktopAppInfo.new(f"{app_id}.desktop") \
- or Gio.DesktopAppInfo.new(f"{app_id.lower()}.desktop")
+ app_info = try_desktop_app_info(f"{app_id}.desktop") \
+ or try_desktop_app_info(f"{app_id.lower()}.desktop")
if app_info is None:
for info in Gio.AppInfo.get_all():