summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/shell')
-rw-r--r--accounts/gkleen@sif/shell/quickshell/Bar.qml6
-rw-r--r--accounts/gkleen@sif/shell/quickshell/Lockscreen.qml2
-rw-r--r--accounts/gkleen@sif/shell/quickshell/LockscreenInhibitorWidget.qml48
-rw-r--r--accounts/gkleen@sif/shell/quickshell/Services/InhibitorState.qml1
4 files changed, 54 insertions, 3 deletions
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 {
112 112
113 BatteryWidget {} 113 BatteryWidget {}
114 114
115 LockscreenInhibitorWidget {}
116
115 WaylandInhibitorWidget { 117 WaylandInhibitorWidget {
116 window: bar 118 window: bar
117 } 119 }
118 120
119 NotificationInhibitorWidget {}
120
121 LidSwitchInhibitorWidget {} 121 LidSwitchInhibitorWidget {}
122 122
123 NotificationInhibitorWidget {}
124
123 Item { 125 Item {
124 height: parent.height 126 height: parent.height
125 width: 8 - 4 127 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 {
47 47
48 IdleMonitor { 48 IdleMonitor {
49 id: idleMonitor 49 id: idleMonitor
50 enabled: !lock.secure 50 enabled: !lock.secure && !InhibitorState.lockscreenInhibited
51 timeout: 600 51 timeout: 600
52 respectInhibitors: true 52 respectInhibitors: true
53 53
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 @@
1import Quickshell
2import QtQuick
3import Quickshell.Widgets
4import qs.Services
5
6Item {
7 id: root
8
9 width: icon.width + 8
10 height: parent.height
11 anchors.verticalCenter: parent.verticalCenter
12
13 WrapperMouseArea {
14 id: widgetMouseArea
15
16 anchors.fill: parent
17
18 // enabled: InhibitorState.lockscreenInhibited || !InhibitorState.waylandIdleInhibited
19 hoverEnabled: true
20 cursorShape: widgetMouseArea.enabled ? Qt.PointingHandCursor : undefined
21
22 onClicked: InhibitorState.lockscreenInhibited = !InhibitorState.lockscreenInhibited
23
24 Rectangle {
25 anchors.fill: parent
26 color: {
27 if (widgetMouseArea.containsMouse) {
28 return "#33808080";
29 }
30 return "transparent";
31 }
32
33 Item {
34 anchors.fill: parent
35
36 MaterialDesignIcon {
37 id: icon
38
39 implicitSize: 14
40 anchors.centerIn: parent
41
42 icon: InhibitorState.lockscreenInhibited || InhibitorState.waylandIdleInhibited ? "lock-off" : "lock"
43 color: InhibitorState.lockscreenInhibited ? "#f28a21" : "#555"
44 }
45 }
46 }
47 }
48}
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 {
8 8
9 property bool waylandIdleInhibited: false 9 property bool waylandIdleInhibited: false
10 property alias lidSwitchInhibited: lidSwitchInhibitor.enabled 10 property alias lidSwitchInhibited: lidSwitchInhibitor.enabled
11 property bool lockscreenInhibited: false
11 12
12 Custom.SystemdInhibitor { 13 Custom.SystemdInhibitor {
13 id: lidSwitchInhibitor 14 id: lidSwitchInhibitor