From 78d96977f3611894e14871390cd668eb0f15a265 Mon Sep 17 00:00:00 2001 From: Eriq Taing Date: Fri, 26 Sep 2025 17:00:51 -0400 Subject: [PATCH] Added power button to top right --- bar/Bar.qml | 4 ++++ bar/PowerButton.qml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 bar/PowerButton.qml diff --git a/bar/Bar.qml b/bar/Bar.qml index b15f8a0..134a54c 100644 --- a/bar/Bar.qml +++ b/bar/Bar.qml @@ -88,6 +88,10 @@ Scope { Layout.fillHeight: true Layout.fillWidth: false } + PowerButton { + Layout.fillWidth: false + Layout.fillHeight: true + } } } } diff --git a/bar/PowerButton.qml b/bar/PowerButton.qml new file mode 100644 index 0000000..173088e --- /dev/null +++ b/bar/PowerButton.qml @@ -0,0 +1,35 @@ +import qs +import qs.common +import qs.common.widgets +import QtQuick +import QtQuick.Layouts +import Quickshell.Io + +Item { + id: root + + height: parent.height + implicitWidth: parent.height + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton + onPressed: (event) => { + powermenu.exec({}); + } + Process { + id: powermenu + running: false + command: [ "wlogout" ] + } + } + + MaterialSymbol { + anchors.fill: parent + visible: true + fill: 1 + text: "mode_off_on" + iconSize: Appearance.font.pixelSize.larger + color: Appearance.m3colors.m3onSecondaryContainer + } +} \ No newline at end of file