nixos-dotfiles

nixos-dotfiles

https://git.tonybtw.com/nixos-dotfiles.git git://git.tonybtw.com/nixos-dotfiles.git
10,094 bytes raw
1
import Quickshell
2
import Quickshell.Wayland
3
import Quickshell.Io
4
import Quickshell.I3
5
import QtQuick
6
import QtQuick.Layouts
7
8
ShellRoot {
9
    Dashboard {
10
        id: dashboard
11
    }
12
    Variants {
13
        model: Quickshell.screens
14
        
15
        PanelWindow {
16
            property var modelData
17
            screen: modelData
18
            
19
            anchors {
20
                top: true
21
                left: true
22
                right: true
23
            }
24
            
25
            implicitHeight: 30
26
            color: "#1a1b26"
27
            
28
            margins {
29
                top: 0
30
                bottom: 0
31
                left: 0
32
                right: 0
33
            }
34
            
35
            Rectangle {
36
                anchors.fill: parent
37
                color: "#1a1b26"
38
                
39
                RowLayout {
40
                    anchors.fill: parent
41
                    spacing: 0
42
                    
43
                    Item { width: 8 }
44
                    
45
                    Rectangle {
46
                        Layout.preferredWidth: 24
47
                        Layout.preferredHeight: 24
48
                        color: "transparent"
49
                        
50
                        Image {
51
                            anchors.fill: parent
52
                            source: "file:///home/tony/.config/quickshell/icons/tonybtw.png"
53
                            fillMode: Image.PreserveAspectFit
54
                        }
55
                    }
56
                    
57
                    Item { width: 8 }
58
                    
59
                    Repeater {
60
                        model: 9
61
                        
62
                        Rectangle {
63
                            Layout.preferredWidth: 30
64
                            Layout.preferredHeight: parent.height
65
                            color: "transparent"
66
                            
67
                            property var workspace: {
68
                                for (var i = 0; i < I3.workspaces.values.length; i++) {
69
                                    var ws = I3.workspaces.values[i];
70
                                    if (ws.num === (index + 1)) {
71
                                        return ws;
72
                                    }
73
                                }
74
                                return null;
75
                            }
76
                            
77
                            property bool isActive: workspace ? workspace.active : false
78
                            property bool hasWindows: workspace !== null
79
                            
80
                            Column {
81
                                anchors.centerIn: parent
82
                                spacing: 0
83
                                
84
                                Text {
85
                                    text: index + 1
86
                                    color: parent.parent.isActive ? "#0db9d7" : (parent.parent.hasWindows ? "#0db9d7" : "#444b6a")
87
                                    font.pixelSize: 16
88
                                    font.family: "JetBrainsMono Nerd Font"
89
                                    font.bold: true
90
                                    horizontalAlignment: Text.AlignHCenter
91
                                    anchors.horizontalCenter: parent.horizontalCenter
92
                                }
93
                                
94
                                Rectangle {
95
                                    width: 20
96
                                    height: 3
97
                                    color: parent.parent.isActive ? "#ad8ee6" : "#1a1b26"
98
                                    anchors.horizontalCenter: parent.horizontalCenter
99
                                }
100
                            }
101
                            
102
                            MouseArea {
103
                                anchors.fill: parent
104
                                onClicked: {
105
                                    I3.dispatch("workspace number " + (index + 1));
106
                                }
107
                            }
108
                        }
109
                    }
110
                    
111
                    Rectangle {
112
                        Layout.preferredWidth: 1
113
                        Layout.preferredHeight: 16
114
                        Layout.alignment: Qt.AlignVCenter
115
                        Layout.leftMargin: 8
116
                        Layout.rightMargin: 8
117
                        color: "#444b6a"
118
                    }
119
                    
120
                    Text {
121
                        text: "Tile"
122
                        color: "#a9b1d6"
123
                        font.pixelSize: 14
124
                        font.family: "JetBrainsMono Nerd Font"
125
                        font.bold: true
126
                        Layout.leftMargin: 5
127
                        Layout.rightMargin: 5
128
                    }
129
                    
130
                    Rectangle {
131
                        Layout.preferredWidth: 1
132
                        Layout.preferredHeight: 16
133
                        Layout.alignment: Qt.AlignVCenter
134
                        Layout.leftMargin: 2
135
                        Layout.rightMargin: 8
136
                        color: "#444b6a"
137
                    }
138
                    
139
                    Text {
140
                        text: "Window"
141
                        color: "#ad8ee6"
142
                        font.pixelSize: 14
143
                        font.family: "JetBrainsMono Nerd Font"
144
                        font.bold: true
145
                        Layout.fillWidth: true
146
                        Layout.leftMargin: 8
147
                        elide: Text.ElideRight
148
                        maximumLineCount: 1
149
                    }
150
                    
151
                    Text {
152
                        text: "Linux"
153
                        color: "#e0af68"
154
                        font.pixelSize: 14
155
                        font.family: "JetBrainsMono Nerd Font"
156
                        font.bold: true
157
                        Layout.rightMargin: 8
158
                    }
159
                    
160
                    Rectangle {
161
                        Layout.preferredWidth: 1
162
                        Layout.preferredHeight: 16
163
                        Layout.alignment: Qt.AlignVCenter
164
                        Layout.leftMargin: 0
165
                        Layout.rightMargin: 8
166
                        color: "#444b6a"
167
                    }
168
                    
169
                    Text {
170
                        text: "CPU: --"
171
                        color: "#e0af68"
172
                        font.pixelSize: 14
173
                        font.family: "JetBrainsMono Nerd Font"
174
                        font.bold: true
175
                        Layout.rightMargin: 8
176
                    }
177
                    
178
                    Rectangle {
179
                        Layout.preferredWidth: 1
180
                        Layout.preferredHeight: 16
181
                        Layout.alignment: Qt.AlignVCenter
182
                        Layout.leftMargin: 0
183
                        Layout.rightMargin: 8
184
                        color: "#444b6a"
185
                    }
186
                    
187
                    Text {
188
                        text: "Mem: --"
189
                        color: "#0db9d7"
190
                        font.pixelSize: 14
191
                        font.family: "JetBrainsMono Nerd Font"
192
                        font.bold: true
193
                        Layout.rightMargin: 8
194
                    }
195
                    
196
                    Rectangle {
197
                        Layout.preferredWidth: 1
198
                        Layout.preferredHeight: 16
199
                        Layout.alignment: Qt.AlignVCenter
200
                        Layout.leftMargin: 0
201
                        Layout.rightMargin: 8
202
                        color: "#444b6a"
203
                    }
204
                    
205
                    Text {
206
                        text: "Disk: --"
207
                        color: "#7aa2f7"
208
                        font.pixelSize: 14
209
                        font.family: "JetBrainsMono Nerd Font"
210
                        font.bold: true
211
                        Layout.rightMargin: 8
212
                    }
213
                    
214
                    Rectangle {
215
                        Layout.preferredWidth: 1
216
                        Layout.preferredHeight: 16
217
                        Layout.alignment: Qt.AlignVCenter
218
                        Layout.leftMargin: 0
219
                        Layout.rightMargin: 8
220
                        color: "#444b6a"
221
                    }
222
                    
223
                    Text {
224
                        text: "Vol: --"
225
                        color: "#ad8ee6"
226
                        font.pixelSize: 14
227
                        font.family: "JetBrainsMono Nerd Font"
228
                        font.bold: true
229
                        Layout.rightMargin: 8
230
                    }
231
                    
232
                    Rectangle {
233
                        Layout.preferredWidth: 1
234
                        Layout.preferredHeight: 16
235
                        Layout.alignment: Qt.AlignVCenter
236
                        Layout.leftMargin: 0
237
                        Layout.rightMargin: 8
238
                        color: "#444b6a"
239
                    }
240
                    
241
                    Text {
242
                        id: clockText
243
                        text: Qt.formatDateTime(new Date(), "ddd, MMM dd - HH:mm")
244
                        color: "#0db9d7"
245
                        font.pixelSize: 14
246
                        font.family: "JetBrainsMono Nerd Font"
247
                        font.bold: true
248
                        Layout.rightMargin: 8
249
                        
250
                        Timer {
251
                            interval: 1000
252
                            running: true
253
                            repeat: true
254
                            onTriggered: clockText.text = Qt.formatDateTime(new Date(), "ddd, MMM dd - HH:mm")
255
                        }
256
                    }
257
                    
258
                    Item { width: 8 }
259
                }
260
            }
261
        }
262
    }
263
}