From 6f6dd46df02965e2f64a9ce758fa215766be771d Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Wed, 13 Aug 2025 00:12:13 +0545 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(dock):=20add=20option=20to=20h?= =?UTF-8?q?ide=20apps=20from=20special=20workspaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/dock.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/modules/dock.py b/modules/dock.py index 0bc4144..c3dbf8d 100644 --- a/modules/dock.py +++ b/modules/dock.py @@ -377,6 +377,10 @@ class AppBar(Box): if client.get("hidden", False): continue + # Skip apps in special workspaces if configured to hide them + if not self._should_show_app_instance(client): + continue + instance_address = client.get("address", "") if not instance_address: continue @@ -406,6 +410,7 @@ class AppBar(Box): for client in clients if not client.get("hidden", False) and (client.get("class") or client.get("title")) + and self._should_show_app_instance(client) } for app_identifier, button in self.pinned_buttons.items(): @@ -493,6 +498,30 @@ class AppBar(Box): return workspace_data return None + def _is_special_workspace_id(self, ws_id): + """Check if a workspace ID represents a special workspace""" + try: + # Convert to int if it's a string + workspace_id = int(ws_id) + # Special workspaces have negative IDs + return workspace_id < 0 + except (ValueError, TypeError): + # If it's a string, check if it starts with "special:" + if isinstance(ws_id, str) and ws_id.startswith("special:"): + return True + return False + + def _should_show_app_instance(self, client): + """Determine if an app instance should be shown based on workspace and configuration""" + if not data.DOCK_HIDE_SPECIAL_WORKSPACE_APPS: + return True + + workspace_id = self._get_workspace_id(client) + if workspace_id is None: + return True + + return not self._is_special_workspace_id(workspace_id) + def update_instance_button(self, instance_address, client, app_class): if instance_address not in self.client_buttons: return