diff options
| author | 2026-05-13 13:43:17 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:17 +0100 | |
| commit | 1f1710c56a9e810215d6270b6485e0d410e8606d (patch) | |
| tree | ccbb55a20edb68713f8f3ecc336a00336d600f84 /dot_config/sway/executable_tb-autostart.sh | |
| parent | 89c9213617aede2a220a7c3a49e0a76e91e33951 (diff) | |
| download | dotfiles-1f1710c56a9e810215d6270b6485e0d410e8606d.tar.gz dotfiles-1f1710c56a9e810215d6270b6485e0d410e8606d.tar.bz2 dotfiles-1f1710c56a9e810215d6270b6485e0d410e8606d.zip | |
feat(sway): separate thunderbird autostart from super+t launch path
Splitting the for_window 'move to scratchpad' action into a dedicated
autostart helper so that super+t launches TB tiled (not stashed) when TB
isn't already running. Previously the for_window rule would stash every
new main window, forcing the user to press super+t twice after killing
TB manually.
Diffstat (limited to 'dot_config/sway/executable_tb-autostart.sh')
| -rw-r--r-- | dot_config/sway/executable_tb-autostart.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/dot_config/sway/executable_tb-autostart.sh b/dot_config/sway/executable_tb-autostart.sh new file mode 100644 index 0000000..b77431e --- /dev/null +++ b/dot_config/sway/executable_tb-autostart.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# Launch Thunderbird and stash the main window into the scratchpad once sway +# marks it. Used at sway startup so TB is running but hidden from the outset. +# Invoking Super+t (tb-toggle.sh) while TB isn't running takes a different +# path and leaves the window tiled on the current workspace. + +set -eu + +MARK=tb-main + +thunderbird & + +for _ in $(seq 1 200); do + if swaymsg -t get_tree | jq -e --arg m "$MARK" ' + [.. | objects | select(.marks? // [] | index($m))] | length > 0 + ' >/dev/null 2>&1; then + swaymsg "[con_mark=\"$MARK\"] move container to scratchpad" >/dev/null + exit 0 + fi + sleep 0.1 +done |
