diff options
| author | sommerfeld <sommerfeld@sommerfeld.dev> | 2026-08-14 14:21:05 +0100 |
|---|---|---|
| committer | sommerfeld <sommerfeld@sommerfeld.dev> | 2026-08-14 14:21:05 +0100 |
| commit | 6f75cc55c4a2f55d32984e1e6c05d49dca310762 (patch) | |
| tree | a9285ceb6736f1464a0c5201f192e5115e00bfdf /dot_config/sway/executable_tb-autostart.sh | |
| parent | ccbe17845c579d32a994035bfc153d606a9e8a42 (diff) | |
| download | dotfiles-6f75cc55c4a2f55d32984e1e6c05d49dca310762.tar.gz dotfiles-6f75cc55c4a2f55d32984e1e6c05d49dca310762.tar.bz2 dotfiles-6f75cc55c4a2f55d32984e1e6c05d49dca310762.zip | |
Fix Thunderbird scratchpad targeting
Diffstat (limited to 'dot_config/sway/executable_tb-autostart.sh')
| -rw-r--r-- | dot_config/sway/executable_tb-autostart.sh | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/dot_config/sway/executable_tb-autostart.sh b/dot_config/sway/executable_tb-autostart.sh index b7b9b78..d9e503f 100644 --- a/dot_config/sway/executable_tb-autostart.sh +++ b/dot_config/sway/executable_tb-autostart.sh @@ -7,6 +7,8 @@ set -eu MARK=tb-main +APP_ID=org.mozilla.thunderbird +TITLE_SUFFIX="Mozilla Thunderbird" BRIDGE_HOST=127.0.0.1 BRIDGE_IMAP_PORT=1144 BRIDGE_SMTP_PORT=1016 @@ -32,10 +34,17 @@ done flatpak run org.mozilla.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 + tb_id=$(swaymsg -t get_tree | jq -r \ + --arg app "$APP_ID" --arg suffix "$TITLE_SUFFIX" ' + first( + .. | objects + | select(.app_id? == $app) + | select((.name? // "") | endswith($suffix)) + | .id + ) // empty') + if [ -n "$tb_id" ]; then + swaymsg "[con_id=\"$tb_id\"] mark --add $MARK" >/dev/null + swaymsg "[con_id=\"$tb_id\"] move container to scratchpad" >/dev/null exit 0 fi sleep 0.1 |
