From 4817afd1707c9a572af755a4751f97a8fa5a80c1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 22 Jun 2026 11:39:13 +0200 Subject: ... --- accounts/gkleen@sif/shell/quickshell/Bar.qml | 6 ++- .../gkleen@sif/shell/quickshell/Lockscreen.qml | 2 +- .../shell/quickshell/LockscreenInhibitorWidget.qml | 48 ++++++++++++++++++++++ .../shell/quickshell/Services/InhibitorState.qml | 1 + 4 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml (limited to 'accounts') diff --git a/accounts/gkleen@sif/shell/quickshell/Bar.qml b/accounts/gkleen@sif/shell/quickshell/Bar.qml index e8bd6245..bce72077 100644 --- a/accounts/gkleen@sif/shell/quickshell/Bar.qml +++ b/accounts/gkleen@sif/shell/quickshell/Bar.qml @@ -112,14 +112,16 @@ PanelWindow { BatteryWidget {} + LockscreenInhibitorWidget {} + WaylandInhibitorWidget { window: bar } - NotificationInhibitorWidget {} - LidSwitchInhibitorWidget {} + NotificationInhibitorWidget {} + Item { height: parent.height width: 8 - 4 diff --git a/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml b/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml index 30fa68b5..0b4a68b2 100644 --- a/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml +++ b/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml @@ -47,7 +47,7 @@ Scope { IdleMonitor { id: idleMonitor - enabled: !lock.secure + enabled: !lock.secure && !InhibitorState.lockscreenInhibited timeout: 600 respectInhibitors: true diff --git a/accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml b/accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml new file mode 100644 index 00000000..1cbf3f16 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml @@ -0,0 +1,48 @@ +import Quickshell +import QtQuick +import Quickshell.Widgets +import qs.Services + +Item { + id: root + + width: icon.width + 8 + height: parent.height + anchors.verticalCenter: parent.verticalCenter + + WrapperMouseArea { + id: widgetMouseArea + + anchors.fill: parent + + // enabled: InhibitorState.lockscreenInhibited || !InhibitorState.waylandIdleInhibited + hoverEnabled: true + cursorShape: widgetMouseArea.enabled ? Qt.PointingHandCursor : undefined + + onClicked: InhibitorState.lockscreenInhibited = !InhibitorState.lockscreenInhibited + + Rectangle { + anchors.fill: parent + color: { + if (widgetMouseArea.containsMouse) { + return "#33808080"; + } + return "transparent"; + } + + Item { + anchors.fill: parent + + MaterialDesignIcon { + id: icon + + implicitSize: 14 + anchors.centerIn: parent + + icon: InhibitorState.lockscreenInhibited || InhibitorState.waylandIdleInhibited ? "lock-off" : "lock" + color: InhibitorState.lockscreenInhibited ? "#f28a21" : "#555" + } + } + } + } +} diff --git a/accounts/gkleen@sif/shell/quickshell/Services/InhibitorState.qml b/accounts/gkleen@sif/shell/quickshell/Services/InhibitorState.qml index fe48fd7f..60202a29 100644 --- a/accounts/gkleen@sif/shell/quickshell/Services/InhibitorState.qml +++ b/accounts/gkleen@sif/shell/quickshell/Services/InhibitorState.qml @@ -8,6 +8,7 @@ Singleton { property bool waylandIdleInhibited: false property alias lidSwitchInhibited: lidSwitchInhibitor.enabled + property bool lockscreenInhibited: false Custom.SystemdInhibitor { id: lidSwitchInhibitor -- cgit v1.2.3