forked from Shinonome/dots-hyprland
idle inhibitor: use quickshell instead of pythong script
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
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: Persistent.states.idle.inhibit
|
||||
|
||||
function toggleInhibit() {
|
||||
Persistent.states.idle.inhibit = !Persistent.states.idle.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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user