mirror of
https://github.com/bgrolleman/dotfiles.git
synced 2026-05-10 17:11:14 +02:00
Add my noctalia setup config
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.Polkit
|
||||
import Quickshell.Wayland
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
import qs.Services.UI
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property var pluginApi: null
|
||||
|
||||
PolkitAgent {
|
||||
id: agent
|
||||
|
||||
onIsActiveChanged: {
|
||||
if (isActive) {
|
||||
openWindow()
|
||||
} else {
|
||||
closeWindow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property var window: null
|
||||
|
||||
function openWindow() {
|
||||
if (window === null) {
|
||||
window = Qt.createComponent("PolkitWindow.qml").createObject(root, {
|
||||
flow: agent.flow,
|
||||
pluginApi: Qt.binding(function() { return root.pluginApi })
|
||||
});
|
||||
window.visible = true;
|
||||
} else {
|
||||
window.flow = agent.flow
|
||||
window.pluginApi = root.pluginApi
|
||||
window.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
function closeWindow() {
|
||||
if (window !== null) {
|
||||
window.destroy();
|
||||
window = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user