i3: More robust workspace json parsing

Use the name instead of the number as that could be -1.
This commit is contained in:
2025-01-16 14:43:58 +01:00
parent aa4af50cde
commit 6c022fff67

View File

@@ -101,7 +101,7 @@ workspace_auto_back_and_forth yes
# Switch visible workspaces (e.g. multi monitor setup)
bindsym $mod+Tab exec i3-msg workspace "$( \
i3-msg -t get_workspaces | \
jq '.[] | select(.visible and (.focused | not)).num' | \
jq -r '.[] | select(.visible and (.focused | not)).name' | \
head -1)"
# move focused container to workspace