aboutsummaryrefslogtreecommitdiffstats
path: root/shared/Workspaces.qml
diff options
context:
space:
mode:
Diffstat (limited to 'shared/Workspaces.qml')
-rw-r--r--shared/Workspaces.qml39
1 files changed, 39 insertions, 0 deletions
diff --git a/shared/Workspaces.qml b/shared/Workspaces.qml
new file mode 100644
index 0000000..ca4f5b0
--- /dev/null
+++ b/shared/Workspaces.qml
@@ -0,0 +1,39 @@
+// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+pragma Singleton
+
+import Quickshell
+import QtQuick
+
+// The desktop icon for each workspace, the eight waybar drew and the window
+// switcher and the island show. Names, not paths: they are resolved through
+// the active icon theme, so an icon theme switch changes them everywhere.
+// A named workspace, or one past eight, has none, and callers fall back to
+// its number.
+Singleton {
+ readonly property var icons: ({
+ 1: "web-browser",
+ 2: "text-editor",
+ 3: "utilities-terminal",
+ 4: "network-server",
+ 5: "document-edit",
+ 6: "applications-graphics",
+ 7: "dialog-messages",
+ 8: "input-gaming",
+ })
+
+ function icon(name) {
+ const n = parseInt(String(name), 10);
+ if (isNaN(n)) return "";
+ return icons[n] ?? "";
+ }
+}