From 2f126ccb071f6d566824ce80c8b0cffd00a88c86 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:19 +0100 Subject: fix(sway): wait for protonmail-bridge IMAP before launching thunderbird On cold boot Thunderbird would race protonmail-bridge and pop up a 'failed to login to 127.0.0.1' error. Poll 127.0.0.1:1143 (bridge's default IMAP port) for up to 15s before spawning TB. Gives up silently if the bridge doesn't come up. --- dot_config/sway/executable_tb-autostart.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dot_config') diff --git a/dot_config/sway/executable_tb-autostart.sh b/dot_config/sway/executable_tb-autostart.sh index f841428..c711e7f 100644 --- a/dot_config/sway/executable_tb-autostart.sh +++ b/dot_config/sway/executable_tb-autostart.sh @@ -7,6 +7,17 @@ set -eu MARK=tb-main +BRIDGE_PORT=1143 + +# Wait for protonmail-bridge's IMAP listener before launching Thunderbird so +# TB doesn't pop up a "failed to login to 127.0.0.1" error on cold boot. Give +# up after ~15s and launch anyway — the user can reconnect manually. +for _ in $(seq 1 150); do + if ss -ltnH "sport = :$BRIDGE_PORT" 2>/dev/null | grep -q .; then + break + fi + sleep 0.1 +done thunderbird & -- cgit v1.3.1