From b556ef955116bbe6eac78742cbecb943f46a4c72 Mon Sep 17 00:00:00 2001 From: cool-mist Date: Mon, 10 Aug 2026 11:58:43 +0530 Subject: [PATCH] Add quickshell --- private_dot_config/quickshell/BarSettings.qml | 19 ++ private_dot_config/quickshell/InfoBox.qml | 8 + private_dot_config/quickshell/InfoText.qml | 9 + .../quickshell/NetworkClick.qml | 8 + private_dot_config/quickshell/Separator.qml | 6 + private_dot_config/quickshell/shell.qml | 188 ++++++++++++++++++ 6 files changed, 238 insertions(+) create mode 100644 private_dot_config/quickshell/BarSettings.qml create mode 100644 private_dot_config/quickshell/InfoBox.qml create mode 100644 private_dot_config/quickshell/InfoText.qml create mode 100644 private_dot_config/quickshell/NetworkClick.qml create mode 100644 private_dot_config/quickshell/Separator.qml create mode 100644 private_dot_config/quickshell/shell.qml diff --git a/private_dot_config/quickshell/BarSettings.qml b/private_dot_config/quickshell/BarSettings.qml new file mode 100644 index 0000000..135c193 --- /dev/null +++ b/private_dot_config/quickshell/BarSettings.qml @@ -0,0 +1,19 @@ +pragma Singleton +import Quickshell + +Singleton { + readonly property string barBg: "#1a1b26" + readonly property int barWidth: 20 + readonly property int infoBoxHeight: 20 + + readonly property int fontSize: 10 + + readonly property string infoBoxBg: "#1a1b26" + readonly property string infoBoxActive: "#7a1b26" + readonly property string infoBoxUrgent: "#4a1b26" + + readonly property string infoTextActiveFg: "#ffffff" + readonly property string infoTextFg: "#7aa2f7" + + readonly property string separatorFg: "#aaaaaa" +} diff --git a/private_dot_config/quickshell/InfoBox.qml b/private_dot_config/quickshell/InfoBox.qml new file mode 100644 index 0000000..d6bef91 --- /dev/null +++ b/private_dot_config/quickshell/InfoBox.qml @@ -0,0 +1,8 @@ +import QtQuick +import QtQuick.Layouts + +Rectangle { + Layout.preferredWidth: BarSettings.barWidth + Layout.preferredHeight: BarSettings.infoBoxHeight + color: BarSettings.infoBoxBg +} diff --git a/private_dot_config/quickshell/InfoText.qml b/private_dot_config/quickshell/InfoText.qml new file mode 100644 index 0000000..4734137 --- /dev/null +++ b/private_dot_config/quickshell/InfoText.qml @@ -0,0 +1,9 @@ +import QtQuick + +Text { + color: BarSettings.infoTextFg + font.bold: true + font.pixelSize: BarSettings.fontSize + horizontalAlignment: Text.AlignHCenter + anchors.centerIn: parent +} diff --git a/private_dot_config/quickshell/NetworkClick.qml b/private_dot_config/quickshell/NetworkClick.qml new file mode 100644 index 0000000..2e410c4 --- /dev/null +++ b/private_dot_config/quickshell/NetworkClick.qml @@ -0,0 +1,8 @@ +import Quickshell +import QtQuick + +MouseArea { + anchors.fill: parent + onClicked: Quickshell.execDetached(["kitty", "-e", "nmtui"]) + cursorShape: Qt.PointingHandCursor +} diff --git a/private_dot_config/quickshell/Separator.qml b/private_dot_config/quickshell/Separator.qml new file mode 100644 index 0000000..fe99226 --- /dev/null +++ b/private_dot_config/quickshell/Separator.qml @@ -0,0 +1,6 @@ +InfoBox { + InfoText { + color: BarSettings.separatorFg + text: "〰" + } +} diff --git a/private_dot_config/quickshell/shell.qml b/private_dot_config/quickshell/shell.qml new file mode 100644 index 0000000..196531d --- /dev/null +++ b/private_dot_config/quickshell/shell.qml @@ -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 + } + } + } + } +}