quickshell polkit agent

This commit is contained in:
end-4
2025-10-30 19:37:28 +01:00
parent 81116598cb
commit f9c7bbbe01
13 changed files with 210 additions and 5 deletions
@@ -0,0 +1,37 @@
pragma Singleton
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Services.Polkit
Singleton {
id: root
property alias agent: polkitAgent
property alias active: polkitAgent.isActive
property alias flow: polkitAgent.flow
property bool interactionAvailable: false
function cancel() {
root.flow.cancelAuthenticationRequest()
}
function submit(string) {
root.flow.submit(string)
root.interactionAvailable = false
}
Connections {
target: root.flow
function onAuthenticationFailed() {
root.interactionAvailable = true;
}
}
PolkitAgent {
id: polkitAgent
onAuthenticationRequestStarted: {
root.interactionAvailable = true;
}
}
}