init: working version
This commit is contained in:
commit
7d8d7dacae
109 changed files with 15066 additions and 0 deletions
47
services/Idle.qml
Normal file
47
services/Idle.qml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property alias inhibit: inhibitor.running
|
||||
property bool inhibitPipewire
|
||||
|
||||
function toggleInhibitPipewire() {
|
||||
root.inhibitPipewire = !root.inhibitPipewire;
|
||||
pipewireInhibitor.running = true;
|
||||
}
|
||||
|
||||
// Idle Inhibitor
|
||||
|
||||
Process {
|
||||
id: inhibitor
|
||||
command: ["wayland-idle-inhibitor"]
|
||||
}
|
||||
|
||||
// Idle Inhibit on Pipewire
|
||||
|
||||
readonly property string pipewireInhibitorService: "wayland-pipewire-idle-inhibit.service"
|
||||
|
||||
Timer {
|
||||
id: pipewireInhibitorTimer
|
||||
running: true
|
||||
repeat: true
|
||||
triggeredOnStart: true
|
||||
onTriggered: pipewireInhibitorCheck.running = true
|
||||
}
|
||||
|
||||
Process {
|
||||
id: pipewireInhibitorCheck
|
||||
command: ["systemctl", "status", "--user", root.pipewireInhibitorService]
|
||||
onExited: (code, _) => root.inhibitPipewire = (code === 0)
|
||||
}
|
||||
|
||||
Process {
|
||||
id: pipewireInhibitor
|
||||
command: ["systemctl", root.inhibitPipewire ? "start" : "stop", "--user", root.pipewireInhibitorService]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue