diff --git a/src/shell.qml b/src/shell.qml index e25ad07..2d95577 100644 --- a/src/shell.qml +++ b/src/shell.qml @@ -12,4 +12,32 @@ ShellRoot { } } } + + Component.onCompleted: { + Quickshell.reloadCompleted.connect(() => loader.active = false); + Quickshell.reloadFailed.connect(e => { + loader.active = true; + loader.message = e; + }); + } + + LazyLoader { + id: loader + + property string message: "" + + PanelWindow { + anchors { + top: true + left: true + right: true + } + + Text { + anchors.centerIn: parent + anchors.fill: parent + text: loader.message + } + } + } } diff --git a/src/widgets/workspaces/WorkspaceIPC.qml b/src/widgets/workspaces/WorkspaceIPC.qml index ee18d6f..58d0674 100644 --- a/src/widgets/workspaces/WorkspaceIPC.qml +++ b/src/widgets/workspaces/WorkspaceIPC.qml @@ -1,4 +1,5 @@ import QtQuick +import Quickshell import Quickshell.Io import Quickshell.Hyprland import Quickshell.I3 @@ -24,27 +25,19 @@ Item { } } - Process { - command: ["env"] - running: true + Component.onCompleted: { + root.name = Quickshell.env("XDG_CURRENT_DESKTOP"); - stdout: SplitParser { - onRead: data => { - if (data.startsWith("XDG_CURRENT_DESKTOP=")) { - root.name = data.slice(20); - switch (root.name) { - case "sway": - case "none+i3": - root.active = Qt.binding(() => I3.focusedWorkspace?.num ?? root.active); - break; - case "Hyprland": - root.active = Qt.binding(() => Hyprland.focusedMonitor?.activeWorkspace?.id ?? root.active); - break; - default: - console.log("This desktop is unhandled:", root.name); - } - } - } + switch (root.name) { + case "sway": + case "none+i3": + root.active = Qt.binding(() => I3.focusedWorkspace?.num ?? root.active); + break; + case "Hyprland": + root.active = Qt.binding(() => Hyprland.focusedMonitor?.activeWorkspace?.id ?? root.active); + break; + default: + console.log("This desktop is unhandled:", root.name); } } }