lock: ctrl+enter to also turn on idle inhibitor

This commit is contained in:
end-4
2025-12-04 20:40:33 +01:00
parent e9b5e7d7d2
commit 8e704e4009
5 changed files with 38 additions and 14 deletions
+13 -9
View File
@@ -1,8 +1,8 @@
pragma Singleton
import qs.modules.common
import QtQuick
import Quickshell
import Quickshell.Wayland
pragma Singleton
/**
* A nice wrapper for date and time strings.
@@ -17,21 +17,26 @@ Singleton {
target: Persistent
function onReadyChanged() {
if (!Persistent.isNewHyprlandInstance) {
root.inhibit = Persistent.states.idle.inhibit
root.inhibit = Persistent.states.idle.inhibit;
} else {
Persistent.states.idle.inhibit = root.inhibit
Persistent.states.idle.inhibit = root.inhibit;
}
}
}
function toggleInhibit() {
root.inhibit = !root.inhibit
Persistent.states.idle.inhibit = root.inhibit
function toggleInhibit(active = null) {
if (active !== null) {
root.inhibit = active;
} else {
root.inhibit = !root.inhibit;
}
Persistent.states.idle.inhibit = root.inhibit;
}
IdleInhibitor {
id: idleInhibitor
window: PanelWindow { // Inhibitor requires a "visible" surface
window: PanelWindow {
// Inhibitor requires a "visible" surface
// Actually not lol
implicitWidth: 0
implicitHeight: 0
@@ -46,6 +51,5 @@ Singleton {
item: null
}
}
}
}
}