summaryrefslogtreecommitdiff
path: root/accounts/gkleen@skadhi/shell/quickshell/Bar.qml
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2026-09-23 21:08:35 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2026-09-23 21:08:35 +0200
commitae9a80c1f012686c1f65fce7ce76fdd1b77b0b71 (patch)
tree141f738276cf84c6b7e5633c2bd5f2b44e9b0b75 /accounts/gkleen@skadhi/shell/quickshell/Bar.qml
parent6a763272038e637a8a03dd9059d43a1ff44921dd (diff)
downloadnixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar
nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar.gz
nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar.bz2
nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar.xz
nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.zip
...
Diffstat (limited to 'accounts/gkleen@skadhi/shell/quickshell/Bar.qml')
-rw-r--r--accounts/gkleen@skadhi/shell/quickshell/Bar.qml142
1 files changed, 142 insertions, 0 deletions
diff --git a/accounts/gkleen@skadhi/shell/quickshell/Bar.qml b/accounts/gkleen@skadhi/shell/quickshell/Bar.qml
new file mode 100644
index 00000000..33909884
--- /dev/null
+++ b/accounts/gkleen@skadhi/shell/quickshell/Bar.qml
@@ -0,0 +1,142 @@
1import Quickshell
2import Quickshell.Wayland
3import QtQuick
4import qs.Services
5
6PanelWindow {
7 id: bar
8
9 WlrLayershell.namespace: "bar"
10
11 property bool haveMaximizedWindow: {
12 let currWindowId = Array.from(NiriService.workspaces).find(ws => {
13 return ws.output === bar.screen.name && ws.is_active;
14 })?.active_window_id;
15 let activeWindowTileSize = Array.from(NiriService.windows).find(win => win.id == currWindowId)?.layout?.tile_size;
16
17 if (!activeWindowTileSize)
18 return false;
19 return activeWindowTileSize[0] >= bar.screen.width && activeWindowTileSize[1] >= bar.screen.height - bar.height;
20 }
21
22 anchors {
23 top: true
24 left: true
25 right: true
26 }
27 margins {
28 left: bar.haveMaximizedWindow ? 0 : 26 + 8
29 right: bar.haveMaximizedWindow ? 0 : 26 + 8
30 }
31
32 implicitHeight: 21
33 color: "transparent"
34
35 property bool haveScreenshare: Array.from(NiriService.casts).some(cast => cast.target.Output?.name == bar.screen.name)
36
37 Rectangle {
38 color: {
39 if (bar.haveScreenshare)
40 return bar.haveMaximizedWindow ? Qt.rgba(0.2, 0, 0, 1) : Qt.rgba(0.2, 0, 0, 0.75);
41 return bar.haveMaximizedWindow ? "black" : Qt.rgba(0, 0, 0, 0.75);
42 }
43 anchors.fill: parent
44 // bottomLeftRadius: 8
45 // bottomRightRadius: 8
46 }
47
48 Row {
49 id: left
50
51 height: parent.height
52 width: childrenRect.width
53 anchors.left: parent.left
54 anchors.leftMargin: 8
55 anchors.verticalCenter: parent.verticalCenter
56 spacing: 8
57
58 WorkspaceSwitcher {
59 screen: bar.screen
60 }
61 }
62
63 Row {
64 id: center
65
66 height: parent.height
67 width: childrenRect.width
68 anchors.centerIn: parent
69 spacing: 5
70
71 ActiveWindowDisplay {
72 screen: bar.screen
73 maxWidth: bar.width - 2*Math.max(left.width, right.width) - 2*8
74 }
75 }
76
77 Row {
78 id: right
79
80 height: parent.height
81 width: childrenRect.width
82 anchors.right: parent.right
83 anchors.rightMargin: 8
84 anchors.verticalCenter: parent.verticalCenter
85 spacing: 0
86
87 WorktimeWidget {}
88
89 KeyboardLayout {}
90
91 Item {
92 visible: privacy.visible || ytDlp.visible
93 height: parent.height
94 width: 8 - 4
95 }
96
97 PrivacyWidget {
98 id: privacy
99 }
100
101 Item {
102 visible: privacy.visible && ytDlp.visible
103 height: parent.height
104 width: 8 - 4
105 }
106
107 YtDlpWidget {
108 id: ytDlp
109 }
110
111 Item {
112 visible: privacy.visible || ytDlp.visible
113 height: parent.height
114 width: 8 - 4
115 }
116
117 SystemTray {}
118
119 PipewireWidget {}
120
121 BrightnessWidget {}
122
123 BatteryWidget {}
124
125 LockscreenInhibitorWidget {}
126
127 WaylandInhibitorWidget {
128 window: bar
129 }
130
131 LidSwitchInhibitorWidget {}
132
133 NotificationInhibitorWidget {}
134
135 Item {
136 height: parent.height
137 width: 8 - 4
138 }
139
140 Clock {}
141 }
142} \ No newline at end of file