diff options
| author | 2026-05-13 13:43:17 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:17 +0100 | |
| commit | 9f3b9f1dcc756dd94192da090388c1aa90320d23 (patch) | |
| tree | 27ffd1f93866323f9f1c3e5ea77aa28bc0bf1bde /dot_config/sway/executable_tb-toggle.sh | |
| parent | 0426222d312a2e1fa9632bb8b14ced8eee75fcae (diff) | |
| download | dotfiles-9f3b9f1dcc756dd94192da090388c1aa90320d23.tar.gz dotfiles-9f3b9f1dcc756dd94192da090388c1aa90320d23.tar.bz2 dotfiles-9f3b9f1dcc756dd94192da090388c1aa90320d23.zip | |
fix(sway): use get_workspaces for current ws in tb-toggle
get_tree's workspace nodes don't carry a .focused field (only con nodes
do), so current_ws was empty and the script emitted a malformed swaymsg
command. get_workspaces exposes .focused directly on each workspace.
Diffstat (limited to 'dot_config/sway/executable_tb-toggle.sh')
| -rw-r--r-- | dot_config/sway/executable_tb-toggle.sh | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/dot_config/sway/executable_tb-toggle.sh b/dot_config/sway/executable_tb-toggle.sh index d1e8a83..5288484 100644 --- a/dot_config/sway/executable_tb-toggle.sh +++ b/dot_config/sway/executable_tb-toggle.sh @@ -8,12 +8,10 @@ set -eu STASH=_tb MARK=tb-main -tree=$(swaymsg -t get_tree) +current_ws=$(swaymsg -t get_workspaces \ + | jq -r '.[] | select(.focused) | .name') -current_ws=$(printf '%s' "$tree" \ - | jq -r 'first(.. | objects | select(.type=="workspace" and .focused) | .name) // empty') - -tb_ws=$(printf '%s' "$tree" \ +tb_ws=$(swaymsg -t get_tree \ | jq -r --arg m "$MARK" ' first( .. | objects |
