mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-08 08:19:26 -05:00
53 lines
1.2 KiB
QML
53 lines
1.2 KiB
QML
import qs
|
|
import qs.modules.common
|
|
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Wayland
|
|
pragma Singleton
|
|
|
|
/**
|
|
* A nice wrapper for date and time strings.
|
|
*/
|
|
Singleton {
|
|
id: root
|
|
|
|
property alias inhibit: idleInhibitor.enabled
|
|
inhibit: false
|
|
|
|
Connections {
|
|
target: Persistent
|
|
function onReadyChanged() {
|
|
if (!Persistent.isNewHyprlandInstance) {
|
|
root.inhibit = Persistent.states.idle.inhibit
|
|
} else {
|
|
Persistent.states.idle.inhibit = root.inhibit
|
|
}
|
|
}
|
|
}
|
|
|
|
function toggleInhibit() {
|
|
root.inhibit = !root.inhibit
|
|
Persistent.states.idle.inhibit = root.inhibit
|
|
}
|
|
|
|
IdleInhibitor {
|
|
id: idleInhibitor
|
|
window: PanelWindow { // Inhibitor requires a "visible" surface
|
|
// Actually not lol
|
|
implicitWidth: 0
|
|
implicitHeight: 0
|
|
color: "transparent"
|
|
// Just in case...
|
|
anchors {
|
|
right: true
|
|
bottom: true
|
|
}
|
|
// Make it not interactable
|
|
mask: Region {
|
|
item: null
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|