Luigit
repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by admin

quickshell/nuguland/AuroraShader.qml

Raw
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell.Io

// The aurora behind the desktop and the lock: nothing renders without its
// compiled blob or while inactive.
Item {
    id: root

    property bool active: true
    property real time: 0
    property vector2d mouse: Qt.vector2d(0.5, 0.5)
    property real firestormMix: 0
    property bool available: false
    readonly property bool rendering: loader.item !== null

    FileView {
        path: Qt.resolvedUrl("shaders/aurora.frag.qsb").toString().replace(/^file:\/\//, "")
        preload: true
        blockLoading: true
        printErrors: false
        onLoaded: root.available = true
        onLoadFailed: root.available = false
    }

    Loader {
        id: loader

        anchors.fill: parent
        active: root.available && root.active

        sourceComponent: ShaderEffect {
            property real iTime: root.time
            property vector2d iResolution: Qt.vector2d(width, height)
            property vector2d iMouse: root.mouse
            property real iFirestormMix: root.firestormMix

            blending: true
            fragmentShader: Qt.resolvedUrl("shaders/aurora.frag.qsb")
        }
    }
}