From a3784287446cbdffb4dcb0558e9d4351a4792253 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 14 Jan 2025 16:27:52 -0600 Subject: [PATCH] fix up truncation --- src/hyprland.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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: