bar/workspaces: special ws icon config (#785)

* workspaces: icons config

* add README json example
This commit is contained in:
Robin Seger 2025-10-13 13:52:14 +02:00 committed by GitHub
parent dde0f85e78
commit e399a9d7a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 1 deletions

View file

@ -386,7 +386,13 @@ default, you must create it manually.
"occupiedLabel": "󰮯", "occupiedLabel": "󰮯",
"perMonitorWorkspaces": true, "perMonitorWorkspaces": true,
"showWindows": true, "showWindows": true,
"shown": 5 "shown": 5,
"specialWorkspaceIcons": [
{
"name": "steam",
"icon": "sports_esports"
}
]
} }
}, },
"border": { "border": {

View file

@ -68,6 +68,7 @@ JsonObject {
property string occupiedLabel: "󰮯" property string occupiedLabel: "󰮯"
property string activeLabel: "󰮯" property string activeLabel: "󰮯"
property string capitalisation: "preserve" // upper, lower, or preserve - relevant only if label is empty property string capitalisation: "preserve" // upper, lower, or preserve - relevant only if label is empty
property list<var> specialWorkspaceIcons: []
} }
component Tray: JsonObject { component Tray: JsonObject {

View file

@ -194,6 +194,13 @@ Singleton {
function getSpecialWsIcon(name: string): string { function getSpecialWsIcon(name: string): string {
name = name.toLowerCase().slice("special:".length); name = name.toLowerCase().slice("special:".length);
for (const iconConfig of Config.bar.workspaces.specialWorkspaceIcons) {
if (iconConfig.name === name) {
return iconConfig.icon;
}
}
if (name === "special") if (name === "special")
return "star"; return "star";
if (name === "communication") if (name === "communication")