From 5b8cc6eb8dbd5c27779867874416e3b29d396ddc Mon Sep 17 00:00:00 2001 From: Drew Haven Date: Fri, 25 Apr 2025 15:16:45 -0700 Subject: [PATCH] [eww] Filters out empty workspaces, again. --- home-manager/features/eww/config/scripts/workspaces.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/home-manager/features/eww/config/scripts/workspaces.sh b/home-manager/features/eww/config/scripts/workspaces.sh index ea08098..441e50f 100755 --- a/home-manager/features/eww/config/scripts/workspaces.sh +++ b/home-manager/features/eww/config/scripts/workspaces.sh @@ -18,17 +18,15 @@ list_workspaces() { # 1. Select only workspaces on the current monitor. # 2. Remove duplicates (might be a bug with split-monitor-workspaces # 3. Create the output structure + # 4. Select interesting entries, ones that are focused, active or have windows # 5. Sort hyprctl workspaces -j | jq --compact-output --monochrome-output " map( select( .monitor | contains(\"${monitor}\") ) ) | reduce .[] as \$item ( []; if any( .[]; .id == \$item.id ) then . else . + [\$item] end ) | map( { id: .id, name, active: (.id == ${active}), focused: (.id == ${focused}), has_windows: (.lastwindowtitle != \"\") } ) | + map( select (.active or .focused or .has_windows)) | sort_by(.id) " - - # Other lines that may be useful in the future - # - Select interesting entries, ones that are focused, active or have windows - # map( select (.active or .focused or .has_windows)) } monitor=$1