diff --git a/modules/PowerMenu.qml b/modules/PowerMenu.qml index 5c6f38f..59ab4b6 100644 --- a/modules/PowerMenu.qml +++ b/modules/PowerMenu.qml @@ -11,16 +11,12 @@ PanelWindow { required property real anchorX signal menuClosed() + signal runCommand(var cmd) readonly property bool _isNiri: Quickshell.env("NIRI_SOCKET") !== "" - Process { - id: runner - } - function _run(cmd) { - runner.command = cmd; - runner.running = true; + runCommand(cmd); menuClosed(); } diff --git a/modules/Wlogout.qml b/modules/Wlogout.qml index 2f4e9ed..32dc365 100644 --- a/modules/Wlogout.qml +++ b/modules/Wlogout.qml @@ -1,4 +1,5 @@ import QtQuick +import Quickshell import "." as M M.BarIcon { @@ -9,6 +10,10 @@ M.BarIcon { required property var bar + Process { + id: runner + } + MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor @@ -22,6 +27,10 @@ M.BarIcon { screen: root.bar.screen anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0) onMenuClosed: menuLoader.active = false + onRunCommand: cmd => { + runner.command = cmd; + runner.running = true; + } } } }