Repository navigation
Expand file tree
/
Copy pathshell.qml
More file actions
127 lines (108 loc) · 3.16 KB
/
Copy pathshell.qml
File metadata and controls
127 lines (108 loc) · 3.16 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Services.Pipewire
import QtQuick
import QtQuick.Effects
Scope {
id: root
readonly property int frameThickness: 10
readonly property int barHeight: 30
readonly property int cornerRadius: 16
readonly property color frameColor: "#1e1e2e"
// Every monitor's bar reads from this shared clock.
SystemClock {
id: systemClock
precision: SystemClock.Minutes
}
// Track the current output so Quickshell can read its volume and mute state.
PwObjectTracker {
objects: [Pipewire.defaultAudioSink]
}
// Reserve space for tiled windows while letting clicks pass through.
component EdgeReservation: PanelWindow {
color: "transparent"
implicitWidth: 1
implicitHeight: 1
mask: Region {}
}
// Build one frame and one set of edge reservations per screen.
Variants {
model: Quickshell.screens
Scope {
id: monitor
required property var modelData
EdgeReservation {
screen: monitor.modelData
anchors.top: true
exclusiveZone: root.frameThickness
}
EdgeReservation {
screen: monitor.modelData
anchors.left: true
exclusiveZone: root.frameThickness
}
EdgeReservation {
screen: monitor.modelData
anchors.right: true
exclusiveZone: root.frameThickness
}
EdgeReservation {
screen: monitor.modelData
anchors.bottom: true
exclusiveZone: root.barHeight
}
// Shared drawing surface for the frame, bar, and future popups.
PanelWindow {
screen: monitor.modelData
anchors {
top: true
bottom: true
left: true
right: true
}
color: "transparent"
exclusionMode: ExclusionMode.Ignore
// Accept pointer input inside the bottom bar and pass clicks through elsewhere.
mask: Region {
item: barContent
}
// Define the rounded opening used by the visual mask.
Item {
id: opening
anchors.fill: parent
visible: false
layer.enabled: true
Rectangle {
x: root.frameThickness
y: root.frameThickness
width: Math.max(0, parent.width - 2 * root.frameThickness)
height: Math.max(0, parent.height - root.frameThickness - root.barHeight)
radius: root.cornerRadius
}
}
// Paint the frame and use the inverted mask to cut out the opening.
Rectangle {
anchors.fill: parent
color: root.frameColor
layer.enabled: true
layer.effect: MultiEffect {
maskSource: opening
maskEnabled: true
maskInverted: true
}
}
Bar {
id: barContent
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: root.barHeight
screenName: monitor.modelData.name
edgePadding: root.frameThickness
frameColor: root.frameColor
clockText: Qt.formatDateTime(systemClock.date, "hh:mm")
}
}
}
}
}