diff options
Diffstat (limited to 'assistant')
| -rw-r--r-- | assistant/Assistant.qml | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/assistant/Assistant.qml b/assistant/Assistant.qml index 4117882..6d1eeb2 100644 --- a/assistant/Assistant.qml +++ b/assistant/Assistant.qml @@ -89,20 +89,26 @@ Scope { onTriggered: root.shown = false } - Socket { - id: sock - path: `${Quickshell.env("XDG_RUNTIME_DIR") || "/tmp"}/desktop-assistant.sock` - connected: true - onConnectionStateChanged: if (!connected) root.shown = false - parser: SplitParser { onRead: line => root.handle(line) } + // The assistant may start after this shell, or restart: keep trying with + // a fresh Socket each time. Quickshell 0.3.1 keeps the QLocalSocket of a + // failed connect, so setting `connected` again on the same Socket never + // retries: an overlay started before the assistant stayed dark for good. + LazyLoader { + id: link + active: true + Socket { + path: `${Quickshell.env("XDG_RUNTIME_DIR") || "/tmp"}/desktop-assistant.sock` + connected: true + onConnectionStateChanged: if (!connected) root.shown = false + parser: SplitParser { onRead: line => root.handle(line) } + } } - // The assistant may start after this shell, or restart: keep trying. Timer { interval: 2000 repeat: true - running: !sock.connected - onTriggered: sock.connected = true + running: !(link.item?.connected ?? false) + onTriggered: { link.active = false; link.active = true; } } // A config with no visible window exits, reporting nothing. This 1x1 |
