diff options
| author | 2026-05-13 13:43:17 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:17 +0100 | |
| commit | 51d6762a8fd005b7be8e761bff9e09646f62f862 (patch) | |
| tree | 78d8d9bdede0128a15e0809551e0e07420afb974 /dot_config/sway/executable_tb-toggle.sh | |
| parent | 1f1710c56a9e810215d6270b6485e0d410e8606d (diff) | |
| download | dotfiles-51d6762a8fd005b7be8e761bff9e09646f62f862.tar.gz dotfiles-51d6762a8fd005b7be8e761bff9e09646f62f862.tar.bz2 dotfiles-51d6762a8fd005b7be8e761bff9e09646f62f862.zip | |
fix(sway): keep focus on current workspace when stashing tb
Diffstat (limited to 'dot_config/sway/executable_tb-toggle.sh')
| -rw-r--r-- | dot_config/sway/executable_tb-toggle.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dot_config/sway/executable_tb-toggle.sh b/dot_config/sway/executable_tb-toggle.sh index e52f20a..8fc39c0 100644 --- a/dot_config/sway/executable_tb-toggle.sh +++ b/dot_config/sway/executable_tb-toggle.sh @@ -26,5 +26,9 @@ if [ "$tb_ws" = "__i3_scratch" ]; then # current workspace. swaymsg "[con_mark=\"$MARK\"] scratchpad show, floating disable" >/dev/null else + # Criteria-based move can cause sway to follow focus to the originating + # workspace. Pin focus back to where we started. + current_ws=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused) | .name') swaymsg "[con_mark=\"$MARK\"] move container to scratchpad" >/dev/null + swaymsg "workspace \"$current_ws\"" >/dev/null fi |
