diff options
Diffstat (limited to 'window-switcher/Windows.qml')
| -rw-r--r-- | window-switcher/Windows.qml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/window-switcher/Windows.qml b/window-switcher/Windows.qml index 040f4d4..fb582ad 100644 --- a/window-switcher/Windows.qml +++ b/window-switcher/Windows.qml @@ -64,4 +64,28 @@ Singleton { function closeWindow(toplevel) { 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: "utilities-terminal", + 3: "text-editor", + 4: "network-server", + 5: "document-edit", + 6: "applications-graphics", + 7: "internet-chat", + 8: "input-gaming", + }) + + function workspaceIcon(workspace) { + if (!workspace) return ""; + const n = parseInt(String(workspace.name), 10); + if (isNaN(n)) return ""; + return root.workspaceIcons[n] ?? ""; + } } |
