diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-23 15:54:19 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-23 15:54:19 +0200 |
| commit | 8a3c60afbe673fa4061cc8af6accda7368607f77 (patch) | |
| tree | 6160fb4bef3d4f3604aa43d018a5912f20240503 /desktop/Prefs.qml | |
| parent | 246aa68e113f35f87ed985f64abb48cf3d76a23c (diff) | |
| download | quickshell-8a3c60afbe673fa4061cc8af6accda7368607f77.tar.gz quickshell-8a3c60afbe673fa4061cc8af6accda7368607f77.zip | |
companion: shown or hidden survives a restart, with a settings switch
SUPER+\ only flipped a property, so every restart of the desktop shell
brought her back. Whether she is shown is now `companion` in Prefs.qml,
set by the IPC and by a switch on a new Settings > Desktop > Companion
page. Prefs gains `ready`, so she waits for the file rather than showing
at the default and then vanishing; the greeting now plays on every
appearance, the one at login included.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/Prefs.qml')
| -rw-r--r-- | desktop/Prefs.qml | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/desktop/Prefs.qml b/desktop/Prefs.qml index 0ed6ee9..6340b91 100644 --- a/desktop/Prefs.qml +++ b/desktop/Prefs.qml @@ -45,6 +45,17 @@ Singleton { root.write(Object.assign({}, root.doc, { assistant: a })); } + // Whether the desktop companion is shown: SUPER+\ and the Companion + // settings page both set it, so it survives a restart. ready is false + // until the file has been read, so she does not show and then vanish. + property bool companion: true + property bool ready: false + function setCompanion(on) { + if (on === root.companion) return; + root.companion = on; + root.write(Object.assign({}, root.doc, { companion: on })); + } + // The settings window's sidebar width, dragged by its edge. readonly property int sidebarMin: 160 readonly property int sidebarMax: 420 @@ -103,6 +114,8 @@ Singleton { const w = parsed.settings ? parsed.settings.sidebar : undefined; root.settingsSidebar = typeof w === "number" && w >= root.sidebarMin && w <= root.sidebarMax ? Math.round(w) : 200; + root.companion = parsed.companion !== false; + root.ready = true; } FileView { @@ -117,6 +130,6 @@ Singleton { onFileChanged: reload() onLoaded: root.reparse() // Missing file: the defaults, and nothing written. - onLoadFailed: { root.doc = {}; root.pinnedIp = ""; root.presets = null; root.settingsSidebar = 200; root.assistantModel = ""; } + onLoadFailed: { root.doc = {}; root.pinnedIp = ""; root.presets = null; root.settingsSidebar = 200; root.assistantModel = ""; root.companion = true; root.ready = true; } } } |
