JS/TS / fmt & lint (pull_request) Successful in 12s
Rust / clippy & fmt (pull_request) Failing after 43s
C++ / fmt (pull_request) Successful in 5s
Python / fmt & lint (pull_request) Successful in 42s
Python / test & nuitka build (pull_request) Failing after 1m34s
C++ / build & lint (pull_request) Failing after 2m17s
60 lines
911 B
QML
60 lines
911 B
QML
pragma Singleton
|
|
|
|
import Quickshell
|
|
import Quickshell.Io
|
|
import Quickshell.Wayland
|
|
|
|
Singleton {
|
|
id: root
|
|
|
|
property alias enabled: props.enabled
|
|
readonly property alias enabledSince: props.enabledSince
|
|
|
|
onEnabledChanged: {
|
|
if (enabled)
|
|
props.enabledSince = new Date();
|
|
}
|
|
|
|
PersistentProperties {
|
|
id: props
|
|
|
|
property bool enabled
|
|
property date enabledSince
|
|
|
|
reloadableId: "idleInhibitor"
|
|
}
|
|
|
|
IdleInhibitor {
|
|
enabled: props.enabled
|
|
|
|
window: PanelWindow {
|
|
WlrLayershell.namespace: "ZShell-IdleInhibitor"
|
|
color: "transparent"
|
|
implicitHeight: 0
|
|
implicitWidth: 0
|
|
|
|
mask: Region {}
|
|
}
|
|
}
|
|
|
|
IpcHandler {
|
|
function disable(): void {
|
|
props.enabled = false;
|
|
}
|
|
|
|
function enable(): void {
|
|
props.enabled = true;
|
|
}
|
|
|
|
function isEnabled(): bool {
|
|
return props.enabled;
|
|
}
|
|
|
|
function toggle(): void {
|
|
props.enabled = !props.enabled;
|
|
}
|
|
|
|
target: "idleInhibitor"
|
|
}
|
|
}
|