diff options
| author | 2026-05-13 13:43:19 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:19 +0100 | |
| commit | 2f126ccb071f6d566824ce80c8b0cffd00a88c86 (patch) | |
| tree | 65f16bb5e974a3646773adbf5cbd980dd98d2c33 /dot_config/sway/executable_tb-autostart.sh | |
| parent | 52970b1bdb37aaf043c10a151b3ae6f680c174b1 (diff) | |
| download | dotfiles-2f126ccb071f6d566824ce80c8b0cffd00a88c86.tar.gz dotfiles-2f126ccb071f6d566824ce80c8b0cffd00a88c86.tar.bz2 dotfiles-2f126ccb071f6d566824ce80c8b0cffd00a88c86.zip | |
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.
Diffstat (limited to 'dot_config/sway/executable_tb-autostart.sh')
| -rw-r--r-- | dot_config/sway/executable_tb-autostart.sh | 11 |
1 files changed, 11 insertions, 0 deletions
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 & |
