diff options
Diffstat (limited to '.config/quickshell/Modules/Bar.qml')
| -rw-r--r-- | .config/quickshell/Modules/Bar.qml | 162 |
1 files changed, 162 insertions, 0 deletions
diff --git a/.config/quickshell/Modules/Bar.qml b/.config/quickshell/Modules/Bar.qml new file mode 100644 index 0000000..3120574 --- /dev/null +++ b/.config/quickshell/Modules/Bar.qml @@ -0,0 +1,162 @@ +import Quickshell +import Quickshell.Hyprland +import QtQuick +import QtQuick.Layouts +import qs.Services + +Variants { + model: Quickshell.screens; + + delegate: Component { + PanelWindow { + id: root + + required property var modelData + screen: modelData + + property string fontFamily: "FiraCode Nerd Font" + property int fontSize: 14 + + anchors { + top: true + left: true + right: true + } + + implicitHeight: 36 + 8 + + color: "transparent" + + Rectangle { + anchors { + fill: parent + topMargin: 8 + leftMargin: 8 + rightMargin: 8 + } + implicitHeight: 36 + color: "transparent" + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + implicitWidth: workspaces.implicitWidth + 12*2 + height: parent.height + color: Flexoki.bg + radius: 18 + + Row { + id: workspaces + anchors.centerIn: parent + height: 20 + spacing: 6 + + Repeater { + model: ScriptModel { + values: Hyprland.workspaces.values.filter(ws => ws.id >= 0).sort((a, b) => a.id - b.id) + } + + delegate: Rectangle { + required property HyprlandWorkspace modelData + property bool focused: modelData.focused + property bool occupied: modelData.toplevels.values.length > 0 + + width: 20 + height: 20 + radius: 10 + + color: { + if (!focused) return "transparent" + return occupied ? Flexoki.re : Flexoki.ui3 + } + + border.width: 2 + border.color: occupied ? Flexoki.re : Flexoki.ui3 + } + } + } + } + + Music {} + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + implicitWidth: status.implicitWidth + 12*2 + height: parent.height + color: Flexoki.bg + radius: 18 + + RowLayout { + id: status + anchors.centerIn: parent + implicitHeight: parent.implicitHeight + spacing: 24 + + Text { + text: { + // + var icon + if (Volume.volume == 0) { + icon = " " + } else if (Volume.volume < 50) { + icon = " " + } else { + icon = " " + } + return icon + Volume.volume + "%" + } + color: Flexoki.re + font { family: root.fontFamily; pixelSize: root.fontSize } + } + + Text { + text: Wifi.ssid == "" ? " " : " " + Wifi.ssid + color: Flexoki.or + font { family: root.fontFamily; pixelSize: root.fontSize } + } + + Text { + text: " " + Brightness.brightness + "%" + color: Flexoki.ye + font { family: root.fontFamily; pixelSize: root.fontSize } + } + + Text { + text: { + var icon + var i = Math.floor((Battery.capacity - 1) / 10) + switch (Battery.status) { + case "Full": + icon = "" + break + case "Discharging": + icon = ["","","","","","","","","",""][i] + break + case "Charging": + icon = ["","","","","","","","","",""][i] + break + } + return icon + " " + Battery.capacity + "%" + } + color: Flexoki.gr + font { family: root.fontFamily; pixelSize: root.fontSize } + } + + Text { + text: " " + Qt.formatDateTime(Time.time, "MMM d hh:mm:ss") + color: Flexoki.bl + font { family: root.fontFamily; pixelSize: root.fontSize } + } + + Text { + text: "" + color: Flexoki.pu + font { family: root.fontFamily; pixelSize: root.fontSize * 1.5 } + } + } + } + } + } + } +} |
