diff --git a/src/hyprland.nim b/src/hyprland.nim index ab7fa88..9e0e7ee 100644 --- a/src/hyprland.nim +++ b/src/hyprland.nim @@ -1,6 +1,6 @@ import std/[ os, osproc, strformat, strutils, - streams, tables, net, sugar, times + streams, tables, net, sugar, times, unicode ] import ./[lib, swww] import yaml, jsony @@ -102,9 +102,11 @@ proc writeEwwClasses*() = for id in openWorkspaces(monitors): workspaces[id - 1].class.add " ws-button-open" + # truncate icons at 3 windows for ws in workspaces.mitems: - if ws.icon.len > 10: - ws.icon = ws.icon[0..7] & "..." + if ws.icon.runeLen > 3: + ws.icon = + ($(ws.icon.toRunes()[0..2]) & "+") var ewwClasses = collect: