Fast-poll Tailscale and Dropbox at shell startup so icons go live promptly

Both services fire one status poll when the shell starts, but after a fresh
boot that lands before tailscaled has connected or dropboxd has finished its
respawn dance, leaving the bar icons stale for a full 30s/60s refresh
interval. Re-poll every 2s until the service shows up (or ~30s pass), then
hand off to the normal periodic refresh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-20 18:35:19 -07:00
co-authored by Claude Fable 5
parent 0f691d60fb
commit ab0f6a8f2c
2 changed files with 33 additions and 0 deletions
+17
View File
@@ -166,6 +166,23 @@ Item {
onTriggered: root.refresh()
}
Timer {
// After a fresh boot the startup poll usually lands before dropboxd has
// finished its respawn dance, which left the icon stale until the next
// periodic refresh. Poll quickly until the daemon shows up, or give up
// after ~30 seconds.
id: startupRamp
property int ticks: 0
interval: 2000
repeat: true
running: true
onTriggered: {
ticks += 1
if (root.running || ticks >= 15) startupRamp.running = false
else root.refresh()
}
}
Timer {
id: delayedRefresh
interval: 1000
@@ -363,6 +363,22 @@ Item {
onTriggered: root.refresh()
}
Timer {
// After a fresh boot the startup poll usually lands before tailscaled has
// connected, which left the icon stale until the next periodic refresh.
// Poll quickly until the service shows up, or give up after ~30 seconds.
id: startupRamp
property int ticks: 0
interval: 2000
repeat: true
running: true
onTriggered: {
ticks += 1
if (root.running || ticks >= 15) startupRamp.running = false
else root.refresh()
}
}
Timer {
id: delayedRefresh
interval: 600