import QtQuick
import Quickshell
import Quickshell.Hyprland
import Quickshell.Io


Item {  // container, invisible
    id: wlLoader

    Loader {
        id: wlogoutLoader
        active: false
        sourceComponent: Wlogout { id: wLogout }
    }

    GlobalShortcut {
        name: "WLogout"
        description: "Open WLogout"

        onPressed: {
            console.log("Pressed Meta+Shift+W (Hyprland global shortcut)")
            wlogoutLoader.active = !wlogoutLoader.active
        }
    }

    function openWlogout() {
        wlogoutLoader.active = true
    }

    function closeWlogout() {
        wlogoutLoader.active = false
    }
}