From cfe1f948ec32f9814e636f69714485ebd9f88c14 Mon Sep 17 00:00:00 2001 From: Damocles Date: Sun, 12 Apr 2026 15:08:34 +0200 Subject: [PATCH] logout via niri if available --- modules/PowerMenu.qml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/PowerMenu.qml b/modules/PowerMenu.qml index 3c8e1ad..c0eb08a 100644 --- a/modules/PowerMenu.qml +++ b/modules/PowerMenu.qml @@ -12,6 +12,8 @@ PanelWindow { signal menuClosed() + readonly property bool _isNiri: Quickshell.env("NIRI_SOCKET") !== "" + visible: true color: "transparent" @@ -65,11 +67,11 @@ PanelWindow { Repeater { model: [ - { label: "Lock", icon: "\uF023", cmd: ["loginctl", "lock-session"], color: M.Theme.base0D }, - { label: "Suspend", icon: "\uF186", cmd: ["systemctl", "suspend"], color: M.Theme.base0E }, - { label: "Logout", icon: "\uF2F5", cmd: ["loginctl", "terminate-user", ""], color: M.Theme.base0A }, - { label: "Reboot", icon: "\uF021", cmd: ["systemctl", "reboot"], color: M.Theme.base09 }, - { label: "Shutdown", icon: "\uF011", cmd: ["systemctl", "poweroff"], color: M.Theme.base08 } + { label: "Lock", icon: "\uF023", cmd: ["loginctl", "lock-session"], color: M.Theme.base0D }, + { label: "Suspend", icon: "\uF186", cmd: ["systemctl", "suspend"], color: M.Theme.base0E }, + { label: "Logout", icon: "\uF2F5", cmd: menuWindow._isNiri ? ["niri", "msg", "action", "quit"] : ["loginctl", "terminate-user", ""], color: M.Theme.base0A }, + { label: "Reboot", icon: "\uF021", cmd: ["systemctl", "reboot"], color: M.Theme.base09 }, + { label: "Shutdown", icon: "\uF011", cmd: ["systemctl", "poweroff"], color: M.Theme.base08 } ] delegate: Item {