diff --git a/quickshell/Services/PolkitAgentInstance.qml b/quickshell/Services/PolkitAgentInstance.qml new file mode 100644 index 000000000..0b49622e2 --- /dev/null +++ b/quickshell/Services/PolkitAgentInstance.qml @@ -0,0 +1,3 @@ +import Quickshell.Services.Polkit + +PolkitAgent {} diff --git a/quickshell/Services/PolkitService.qml b/quickshell/Services/PolkitService.qml index 5adc4af43..de59bac97 100644 --- a/quickshell/Services/PolkitService.qml +++ b/quickshell/Services/PolkitService.qml @@ -3,7 +3,6 @@ pragma ComponentBehavior: Bound import QtQuick import Quickshell -import Quickshell.Services.Polkit Singleton { id: root @@ -12,10 +11,13 @@ Singleton { readonly property bool disablePolkitIntegration: Quickshell.env("DMS_DISABLE_POLKIT") === "1" readonly property bool polkitAvailable: !disablePolkitIntegration - readonly property alias agent: polkitAgentInstance + readonly property var agent: polkitAgentLoader.item - PolkitAgent { - id: polkitAgentInstance + Loader { + id: polkitAgentLoader + active: root.polkitAvailable + asynchronous: false + source: "PolkitAgentInstance.qml" } Component.onCompleted: {