From c2818ee9acd9e4cdf0ce3d9c081169ce8f84fe50 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Fri, 31 May 2024 14:11:52 -0500 Subject: assign icons based on window class for xwayland windows --- sway-de/xdg-names/.config/xdg-names.ini | 1 + sway-de/xdg-names/.local/bin/xdg-names.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sway-de/xdg-names/.config/xdg-names.ini b/sway-de/xdg-names/.config/xdg-names.ini index 529df80..3a08dd8 100644 --- a/sway-de/xdg-names/.config/xdg-names.ini +++ b/sway-de/xdg-names/.config/xdg-names.ini @@ -7,6 +7,7 @@ icon=_ xwayland=X foot= shotwell= +Signal= [xdg_main] Audio= Video= diff --git a/sway-de/xdg-names/.local/bin/xdg-names.py b/sway-de/xdg-names/.local/bin/xdg-names.py index fb4767a..b5c3e42 100755 --- a/sway-de/xdg-names/.local/bin/xdg-names.py +++ b/sway-de/xdg-names/.local/bin/xdg-names.py @@ -113,7 +113,10 @@ def assign_generic_name(i3, e): else: old_name = con.workspace().name # assume windows without an app_id are xwayland - app_id = "xwayland" if con.app_id is None else con.app_id + if con.app_id is None: + app_id = con.window_class or "xwayland" + else: + app_id = con.app_id name = get_ws_name(con.workspace().num, app_id) i3.command(f'rename workspace "{old_name}" to "{name}"') except Exception as e: -- cgit v1.2.3