hyprland/workspaces: expose workspace name as CSS class

Enable per-workspace styling by adding the workspace name as a
CSS class to each workspace button. The name is sanitized to a
valid CSS identifier: lowercased, non-alphanumeric characters
collapsed to hyphens, digit-leading names prefixed with "ws-".

Examples: "IDE" → .ide, "special:telegram" → .telegram, "1" → .ws-1

Allows users to style individual workspaces:
  #workspaces button.telegram { color: #54a0e0; }
This commit is contained in:
vdermichev
2026-04-05 11:44:56 +02:00
parent 1e965ccce0
commit 2c2901e8f7
2 changed files with 41 additions and 0 deletions
+1
View File
@@ -71,6 +71,7 @@ class Workspace {
int m_id;
std::string m_name;
std::string m_prevNameClass;
std::string m_output;
uint m_windows;
bool m_isActive = false;