diff --git a/home-manager/modules/eww/config/scripts/workspaces.nu b/home-manager/modules/eww/config/scripts/workspaces.nu index 6f8c6be..b2cdc20 100755 --- a/home-manager/modules/eww/config/scripts/workspaces.nu +++ b/home-manager/modules/eww/config/scripts/workspaces.nu @@ -35,9 +35,14 @@ use ipc ipc-cmd def workspaces [] { let workspaces = (ipc-cmd "-t" "get_workspaces" | select id name focused urgent visible) let mode = (ipc-cmd "-t" "get_binding_state") - let focused_title = ((ipc-cmd --raw "-t" "get_tree") | jaq -r '.. | (.nodes? // empty)[] | select(.focused) | {name}' | from json) - - { workspaces: $workspaces, mode: $mode.name, title: $focused_title.name } + let focused_title_full = ((ipc-cmd --raw "-t" "get_tree") | jaq -r '.. | (.nodes? // empty)[] | select(.focused) | {name}' | from json).name + mut focused_title = ($focused_title_full | str substring -g 0..150) + + if ($focused_title_full | str length) > 150 { + $focused_title = ($focused_title | append "..." | str join "") + } + + { workspaces: $workspaces, mode: $mode.name, title: $focused_title } } def main [] {