summaryrefslogtreecommitdiffstats
path: root/quickshell/shell.qml
blob: 6e9ca84e2dd7e2a1cbaf6af300c5dfc51c99de77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//@ pragma UseQApplication

import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import Niri
import "./modules/bar/"
import "./modules/desktop/"
import "./modules/notifications/"

ShellRoot {
    id: root

    Niri {
        id: niri
        Component.onCompleted: connect()

        onConnected: console.info("Connected to niri")
        onErrorOccurred: function(error) {
            console.error("Niri error:", error)
        }
    }

    LazyLoader {
        id: wallLoader
        active: true
        component: Wallpaper {}
    }

    Timer {
        id: wallTimer
        interval: 100
        onTriggered: wallLoader.active = true
    }

    Variants {
        id: barVariants

        model: Quickshell.screens.filter(s => s.name === "HDMI-A-1")

        Bar {}
    }

    IpcHandler {
        target: "shell"

        function restartBar(): void {
            for (const b of barVariants.instances)
                b.restart()
        }

        function restartWall(): void {
            Quickshell.reload(false)
        }
    }

    LazyLoader {
        active: true
        component: Notifications {}
    }
}