aboutsummaryrefslogtreecommitdiffstats
path: root/window-switcher
diff options
context:
space:
mode:
Diffstat (limited to 'window-switcher')
-rw-r--r--window-switcher/Windows.qml24
l---------window-switcher/Workspaces.qml1
2 files changed, 4 insertions, 21 deletions
diff --git a/window-switcher/Windows.qml b/window-switcher/Windows.qml
index ec86ee5..bfd176a 100644
--- a/window-switcher/Windows.qml
+++ b/window-switcher/Windows.qml
@@ -65,27 +65,9 @@ Singleton {
Hyprland.dispatch(`hl.dsp.window.close({ window = "address:${addressOf(toplevel)}" })`);
}
- // The desktop marker on a card is the same icon waybar's bar draws for that
- // workspace, so the switcher and the bar agree. waybar keeps them as CSS
- // background images by workspace number (styles/modules.css); the names are
- // repeated here and resolved through the active icon theme, because a
- // QML-side icon has to go by name. A named workspace, or one past eight,
- // has no icon and the card falls back to its number.
- readonly property var workspaceIcons: ({
- 1: "web-browser",
- 2: "text-editor",
- 3: "utilities-terminal",
- 4: "network-server",
- 5: "document-edit",
- 6: "applications-graphics",
- 7: "dialog-messages",
- 8: "input-gaming",
- })
-
+ // The desktop marker on a card is the same icon the island and the old
+ // waybar bar show for that workspace; the map lives in Workspaces.qml.
function workspaceIcon(workspace) {
- if (!workspace) return "";
- const n = parseInt(String(workspace.name), 10);
- if (isNaN(n)) return "";
- return root.workspaceIcons[n] ?? "";
+ return workspace ? Workspaces.icon(workspace.name) : "";
}
}
diff --git a/window-switcher/Workspaces.qml b/window-switcher/Workspaces.qml
new file mode 120000
index 0000000..712f3d6
--- /dev/null
+++ b/window-switcher/Workspaces.qml
@@ -0,0 +1 @@
+../shared/Workspaces.qml \ No newline at end of file