summaryrefslogtreecommitdiff
path: root/modules/lock/Fetch.qml
blob: afa695039e7b151da8525fbb5c5e91f9001a8f0e (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import qs.components
import qs.services
import qs.config
import qs.utils
import Quickshell
import Quickshell.Widgets
import QtQuick
import QtQuick.Layouts

ColumnLayout {
    id: root

    anchors.fill: parent
    anchors.margins: Appearance.padding.large * 2

    spacing: Appearance.spacing.large * 2

    RowLayout {
        spacing: Appearance.spacing.normal

        StyledRect {
            implicitWidth: prompt.implicitWidth + Appearance.padding.normal * 2
            implicitHeight: prompt.implicitHeight + Appearance.padding.normal * 2

            color: Colours.palette.m3primary
            radius: Appearance.rounding.small

            MonoText {
                id: prompt

                anchors.centerIn: parent
                text: ">"
                color: Colours.palette.m3onPrimary
            }
        }

        MonoText {
            text: "caelestiafetch.sh"
        }
    }

    RowLayout {
        Layout.fillWidth: true
        Layout.fillHeight: true
        spacing: Appearance.spacing.large * 2

        IconImage {
            Layout.fillHeight: true
            source: Quickshell.iconPath(SysInfo.logo)
            implicitSize: height
        }

        ColumnLayout {
            Layout.fillWidth: true
            Layout.fillHeight: true
            spacing: Appearance.spacing.normal

            FetchText {
                text: qsTr("OS  : %1").arg(SysInfo.osPrettyName || SysInfo.osName)
            }

            FetchText {
                text: qsTr("WM  : %1").arg(SysInfo.wm)
            }

            FetchText {
                text: qsTr("USER: %1").arg(SysInfo.user)
            }

            FetchText {
                text: qsTr("SH  : %1").arg(SysInfo.shell)
            }
        }
    }

    RowLayout {
        Layout.alignment: Qt.AlignHCenter
        spacing: Appearance.spacing.large

        Repeater {
            model: 8

            StyledRect {
                required property int index

                implicitWidth: implicitHeight
                implicitHeight: Appearance.font.size.larger * 2
                color: Colours.palette[`term${index}`]
                radius: Appearance.rounding.small
            }
        }
    }

    component FetchText: MonoText {
        font.pointSize: Appearance.font.size.larger
        elide: Text.ElideRight
    }

    component MonoText: StyledText {
        font.family: Appearance.font.family.mono
    }
}