Add quickshell

This commit is contained in:
2026-08-10 11:58:43 +05:30
parent 426fe32a63
commit b556ef9551
6 changed files with 238 additions and 0 deletions
+188
View File
@@ -0,0 +1,188 @@
import Quickshell
import Quickshell.Hyprland
import Quickshell.Networking
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
Variants {
model: Quickshell.screens
PanelWindow {
anchors.top: true
anchors.left: true
anchors.bottom: true
width: BarSettings.barWidth
color: BarSettings.barBg
SystemClock {
id: clock
precision: SystemClock.Seconds
}
Timer {
interval: 5000
running: true
repeat: true
onTriggered: {
cpu_proc.running = true;
gpu_proc.running = true;
}
}
Process {
id: cpu_proc
command: ["hmon", "cpu"]
running: true
stdout: StdioCollector {
onStreamFinished: cpu_text.text = text
}
}
Process {
id: gpu_proc
command: ["hmon", "gpu"]
running: true
stdout: StdioCollector {
onStreamFinished: gpu_text.text = text
}
}
ColumnLayout {
id: workspaces
width: parent.width
anchors {
horizontalCenter: parent.horizontalCenter
}
height: 130
spacing: 1
Repeater {
model: 6
InfoBox {
property var ws: Hyprland.workspaces.values.find(w => w.id === index + 1)
property var isActive: Hyprland.focusedWorkspace?.id === (index + 1)
property var isUrgent: ws?.urgent ?? false
color: isActive ? BarSettings.infoBoxActive : isUrgent ? BarSettings.infoBoxUrgent : BarSettings.infoBoxBg
InfoText {
id: seconds_text
text: index + 1
color: parent.isActive ? BarSettings.infoTextActiveFg : BarSettings.infoTextFg
MouseArea {
anchors.fill: parent
onClicked: Hyprland.dispatch("workspace " + (index + 1))
}
}
}
}
Separator {}
InfoBox {
InfoText {
text: "c"
}
}
InfoBox {
InfoText {
id: cpu_text
}
}
InfoBox {
InfoText {
text: "g"
}
}
InfoBox {
InfoText {
id: gpu_text
}
}
Separator {}
InfoBox {
InfoText {
text: "ᛒ"
font.pixelSize: 15
MouseArea {
anchors.fill: parent
onClicked: Quickshell.execDetached("blueberry")
cursorShape: Qt.PointingHandCursor
}
}
}
InfoBox {
InfoText {
text: "🕪"
font.pixelSize: 13
}
MouseArea {
anchors.fill: parent
onClicked: Quickshell.execDetached("pavucontrol")
cursorShape: Qt.PointingHandCursor
}
}
Separator {}
InfoBox {
InfoText {
text: Networking.connectivity == 4 ? "🌍" : "🚫"
NetworkClick {}
}
}
InfoBox {
InfoText {
text: Networking.devices.values.find(n => n.type == 2).connected ? "🖧" : "🚫"
NetworkClick {}
}
}
InfoBox {
InfoText {
text: Networking.devices.values.find(n => n.type == 1).connected ? "ᯤ" : "🚫"
NetworkClick {}
}
}
}
ColumnLayout {
anchors {
bottom: parent.bottom
horizontalCenter: parent.horizontalCenter
bottomMargin: 8
}
spacing: 5
Repeater {
model: Qt.formatDateTime(clock.date, "hh:mm").split(":")
InfoBox {
InfoText {
text: modelData
}
}
}
InfoBox {
InfoText {
property var ss: Qt.formatDateTime(clock.date, "ss")
text: ss
font.bold: false
}
}
}
}
}