summaryrefslogtreecommitdiffstats
path: root/desktop/modules/shells/ShellsPage.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-28 09:25:50 +0100
committerDanilo M. <danix@danix.xyz>2026-10-28 09:25:50 +0100
commit81d21f2e335d2fd59f8fc43d4788c2426c8a2fe1 (patch)
treebddfb5bc82db54496b1d4a7b44793d9d6c7ac41a /desktop/modules/shells/ShellsPage.qml
parent11c4c745c7ed5477c74abe7de3458924a0567a3a (diff)
downloadquickshell-81d21f2e335d2fd59f8fc43d4788c2426c8a2fe1.tar.gz
quickshell-81d21f2e335d2fd59f8fc43d4788c2426c8a2fe1.zip
shells: a settings page that restarts the shells, with a notification
Settings > Desktop > Shells lists every directory holding a shell.qml, running or stopped by `qs list --all`, with Restart (Start when it is not running) per row and a Restart all. Every button runs reload.sh through Quickshell.execDetached, which leaves the script outside the desktop shell's process, so restarting desktop from its own settings window works: the window closes and the new process carries on. restart.sh wraps reload.sh and sends one notification naming the shells that came back, or a critical one naming those that did not. Back means qs lists an instance on the shell's config path under a pid it did not have before, within 5s; the old instance can linger in the list for a moment after qs kill. It checks the process, not the config, so a shell that starts with a broken component still counts as back. The rows reuse the ai module's AiRow rather than a copy of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/shells/ShellsPage.qml')
-rw-r--r--desktop/modules/shells/ShellsPage.qml51
1 files changed, 51 insertions, 0 deletions
diff --git a/desktop/modules/shells/ShellsPage.qml b/desktop/modules/shells/ShellsPage.qml
new file mode 100644
index 0000000..abbb2b1
--- /dev/null
+++ b/desktop/modules/shells/ShellsPage.qml
@@ -0,0 +1,51 @@
+// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+import QtQuick
+import "../.."
+import "../ai"
+
+// One row per shell, Restart when it runs and Start when it does not, both
+// through reload.sh. The desktop row restarts the process drawing this page.
+Column {
+ id: page
+
+ required property var shells
+
+ spacing: 8
+
+ Component.onCompleted: page.shells.refresh()
+
+ AiRow {
+ width: page.width
+ title: "All shells"
+ detail: "Restarts every one, this window included"
+ on: true
+ action: "Restart all"
+ onTriggered: page.shells.restart("")
+ }
+
+ Repeater {
+ model: page.shells.shells
+
+ AiRow {
+ required property var modelData
+ objectName: "shell:" + modelData.name
+ width: page.width
+ title: modelData.name
+ on: modelData.running
+ detail: (modelData.running ? "Running" : "Stopped")
+ + (modelData.name === "desktop" ? " · hosts this window" : "")
+ action: modelData.running ? "Restart" : "Start"
+ onTriggered: page.shells.restart(modelData.name)
+ }
+ }
+}