From 3d300067f6e179e03d1983159b81e1c2cfe2fa8c Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Fri, 16 Jan 2026 11:04:25 -0500 Subject: refactor qs bar --- .config/quickshell/Modules/Bar.qml | 127 +--------- .config/quickshell/Modules/BarMusic.qml | 298 +++++++++++++++++++++++ .config/quickshell/Modules/BarStatus.qml | 82 +++++++ .config/quickshell/Modules/BarWorkspaces.qml | 48 ++++ .config/quickshell/Modules/Music.qml | 346 --------------------------- .config/quickshell/Modules/MusicPopup.qml | 52 ++++ .config/quickshell/Modules/Wall.qml | 7 + .config/quickshell/Services/Uptime.qml | 8 +- .config/quickshell/Services/Wifi.qml | 4 + 9 files changed, 499 insertions(+), 473 deletions(-) create mode 100644 .config/quickshell/Modules/BarMusic.qml create mode 100644 .config/quickshell/Modules/BarStatus.qml create mode 100644 .config/quickshell/Modules/BarWorkspaces.qml delete mode 100644 .config/quickshell/Modules/Music.qml create mode 100644 .config/quickshell/Modules/MusicPopup.qml (limited to '.config') diff --git a/.config/quickshell/Modules/Bar.qml b/.config/quickshell/Modules/Bar.qml index 8ddd144..ad8b885 100644 --- a/.config/quickshell/Modules/Bar.qml +++ b/.config/quickshell/Modules/Bar.qml @@ -1,8 +1,5 @@ import Quickshell -import Quickshell.Hyprland import QtQuick -import QtQuick.Layouts -import qs.Services Variants { model: Quickshell.screens; @@ -37,129 +34,11 @@ Variants { 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 + BarWorkspaces {} - Row { - id: workspaces - anchors.centerIn: parent - height: 20 - spacing: 6 + BarMusic {} - Repeater { - model: 10 - - delegate: Rectangle { - property HyprlandWorkspace ws: { - Hyprland.workspaces.values.find(ws => ws.id === index + 1) || null - } - property bool focused: { - ws && ws.monitor.name === root.screen.name && ws.focused - } - property bool occupied: { - ws && ws.monitor.name === root.screen.name && ws.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 } - } - } - } + BarStatus {} } } } diff --git a/.config/quickshell/Modules/BarMusic.qml b/.config/quickshell/Modules/BarMusic.qml new file mode 100644 index 0000000..676fcc9 --- /dev/null +++ b/.config/quickshell/Modules/BarMusic.qml @@ -0,0 +1,298 @@ +import Quickshell +import QtQuick +import QtQuick.Layouts +import qs.Services + +MouseArea { + id: root + anchors.centerIn: parent + height: parent.implicitHeight + width: musicRow.implicitWidth + state: "popup-closed" + + hoverEnabled: true + onEntered: state = "popup-open" + + property string fontFamily: "FiraCode Nerd Font" + property int fontSize: 14 + + property int contractAnimDuration: 150 + + states: [ + State { + name: "popup-closed" + PropertyChanges { target: popup; visible: false } + PropertyChanges { target: musicRow; visible: true; spacing: 4 } + PropertyChanges { target: songContainer; bottomRightRadius: 4; topRightRadius: 4 } + PropertyChanges { target: cavaContainer; bottomLeftRadius: 4; topLeftRadius: 4 } + PropertyChanges { target: song; opacity: 1 } + PropertyChanges { target: cava; opacity: 1 } + PropertyChanges { + target: popupRect + width: musicRow.width + height: 36 + opacity: 0 + border.color: Flexoki.bg + } + }, + State { + name: "popup-open" + PropertyChanges { target: popup; visible: true } + PropertyChanges { target: musicRow; visible: false; spacing: -1 } + PropertyChanges { target: songContainer; bottomRightRadius: 0; topRightRadius: 0 } + PropertyChanges { target: cavaContainer; bottomLeftRadius: 0; topLeftRadius: 0 } + PropertyChanges { target: song; opacity: 0 } + PropertyChanges { target: cava; opacity: 0 } + PropertyChanges { + target: popupRect + width: 700 + height: 500 + opacity: 1 + border.color: Flexoki.ui2 + } + } + ] + + transitions: [ + Transition { + from: "popup-closed" + to: "popup-open" + + SequentialAnimation { + // show immediately so mouseleave works + PropertyAction { target: popup; property: "visible" } + + ParallelAnimation { + NumberAnimation { + target: songContainer + properties: "bottomRightRadius,topRightRadius" + duration: root.contractAnimDuration + easing.type: Easing.InQuad + } + + NumberAnimation { + target: cavaContainer + properties: "bottomLeftRadius,topLeftRadius" + duration: root.contractAnimDuration + easing.type: Easing.InQuad + } + + NumberAnimation { + target: musicRow + property: "spacing" + duration: root.contractAnimDuration + easing.type: Easing.OutQuad + } + + NumberAnimation { + targets: [song, cava] + property: "opacity" + duration: root.contractAnimDuration + easing.type: Easing.OutQuad + } + } + + PropertyAction { target: popupRect; property: "opacity" } + PropertyAction { target: musicRow; property: "visible" } + + ParallelAnimation { + NumberAnimation { + target: popupRect + property: "width" + duration: 250 + easing.type: Easing.OutQuad + } + + SpringAnimation { + target: popupRect + property: "height" + spring: 5 + mass: 0.5 + damping: 0.2 + epsilon: 0.25 + } + + ColorAnimation { + target: popupRect + property: "border.color" + duration: 250 + easing.type: Easing.OutQuad + } + } + } + }, + Transition { + // TODO: this transition flickers sometimes + from: "popup-open" + to: "popup-closed" + + SequentialAnimation { + ParallelAnimation { + NumberAnimation { + target: popupRect + property: "width" + duration: 250 + easing.type: Easing.OutQuad + } + + NumberAnimation { + target: popupRect + property: "height" + duration: 250 + easing.type: Easing.OutQuad + } + + ColorAnimation { + target: popupRect + property: "border.color" + duration: 250 + easing.type: Easing.OutQuad + } + } + + PropertyAction { target: musicRow; property: "visible" } + PropertyAction { target: popup; properties: "visible" } + PropertyAction { target: popupRect; property: "opacity" } + + ParallelAnimation { + NumberAnimation { + target: songContainer + properties: "bottomRightRadius,topRightRadius" + duration: root.contractAnimDuration + easing.type: Easing.InQuad + } + + NumberAnimation { + target: cavaContainer + properties: "bottomLeftRadius,topLeftRadius" + duration: root.contractAnimDuration + easing.type: Easing.InQuad + } + + NumberAnimation { + target: musicRow + property: "spacing" + duration: root.contractAnimDuration + easing.type: Easing.OutQuad + } + + NumberAnimation { + targets: [song, cava] + property: "opacity" + duration: root.contractAnimDuration + easing.type: Easing.OutQuad + } + } + } + }, + ] + + PopupWindow { + id: popup + anchor.item: root + anchor.rect.x: root.width / 2 - width / 2 + anchor.rect.y: 0 + implicitWidth: 1920 + implicitHeight: 600 + color: "transparent" + visible: false + + + Rectangle { + id: popupRect + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + color: Flexoki.bg + border.width: 2 + radius: 18 + + MouseArea { + anchors.fill: parent + hoverEnabled: true + onExited: root.state = "popup-closed" + } + + MusicPopup {} + } + } + + Row { + id: musicRow + anchors.centerIn: parent + height: parent.height + spacing: 4 + + Rectangle { + id: songContainer + implicitWidth: song.implicitWidth + 16*2 + height: parent.height + color: Flexoki.bg + + bottomLeftRadius: 18 + topLeftRadius: 18 + bottomRightRadius: 4 + topRightRadius: 4 + + Text { + id: song + anchors.centerIn: parent + text: { + if (!Song.file) return "Not playing" + var text = Song.file + if (Song.title) { + if (Song.artist) { + text = Song.artist + " – " + Song.title + } else { + text = Song.title + } + } + if (text.length > 60) { + text = text.substring(0, 60) + "…" + } + return text + } + color: Flexoki.tx + font { family: root.fontFamily; pixelSize: root.fontSize } + } + } + + Rectangle { + id: cavaContainer + implicitWidth: cava.implicitWidth + 16*2 + height: parent.height + color: Flexoki.bg + + bottomLeftRadius: 4 + topLeftRadius: 4 + bottomRightRadius: 18 + topRightRadius: 18 + + Row { + id: cava + anchors.centerIn: parent + height: 15 + 4 + spacing: 2 + + Repeater { + model: Cava.heights + + delegate: Rectangle { + required property int modelData + y: 15 - modelData + width: 8 + height: modelData + 4 + radius: 4 + color: Flexoki.tx + + Behavior on height { + NumberAnimation { duration: 1000 / 30; easing.type: Easing.Linear } + } + Behavior on y { + NumberAnimation { duration: 1000 / 30; easing.type: Easing.Linear } + } + } + } + } + } + } +} diff --git a/.config/quickshell/Modules/BarStatus.qml b/.config/quickshell/Modules/BarStatus.qml new file mode 100644 index 0000000..436392a --- /dev/null +++ b/.config/quickshell/Modules/BarStatus.qml @@ -0,0 +1,82 @@ +import Quickshell +import QtQuick +import QtQuick.Layouts +import qs.Services + +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 } + } + } +} diff --git a/.config/quickshell/Modules/BarWorkspaces.qml b/.config/quickshell/Modules/BarWorkspaces.qml new file mode 100644 index 0000000..fa95262 --- /dev/null +++ b/.config/quickshell/Modules/BarWorkspaces.qml @@ -0,0 +1,48 @@ +import Quickshell +import Quickshell.Hyprland +import QtQuick +import qs.Services + +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: 10 + + delegate: Rectangle { + property HyprlandWorkspace ws: { + Hyprland.workspaces.values.find(ws => ws.id === index + 1) || null + } + property bool focused: { + ws && ws.monitor && ws.monitor.name === root.screen.name && ws.focused + } + property bool occupied: { + ws && ws.monitor && ws.monitor.name === root.screen.name && ws.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 + } + } + } +} diff --git a/.config/quickshell/Modules/Music.qml b/.config/quickshell/Modules/Music.qml deleted file mode 100644 index 8c79092..0000000 --- a/.config/quickshell/Modules/Music.qml +++ /dev/null @@ -1,346 +0,0 @@ -import Quickshell -import QtQuick -import QtQuick.Layouts -import qs.Services - -MouseArea { - id: root - anchors.centerIn: parent - height: parent.implicitHeight - width: musicRow.implicitWidth - state: "popup-closed" - - hoverEnabled: true - onEntered: state = "popup-open" - - property string fontFamily: "FiraCode Nerd Font" - property int fontSize: 14 - - property int contractAnimDuration: 150 - - states: [ - State { - name: "popup-closed" - PropertyChanges { target: popup; visible: false } - PropertyChanges { target: musicRow; visible: true; spacing: 4 } - PropertyChanges { target: songContainer; bottomRightRadius: 4; topRightRadius: 4 } - PropertyChanges { target: cavaContainer; bottomLeftRadius: 4; topLeftRadius: 4 } - PropertyChanges { target: song; opacity: 1 } - PropertyChanges { target: cava; opacity: 1 } - PropertyChanges { - target: popupRect - width: musicRow.width - height: 36 - opacity: 0 - border.color: Flexoki.bg - } - }, - State { - name: "popup-open" - PropertyChanges { target: popup; visible: true } - PropertyChanges { target: musicRow; visible: false; spacing: -1 } - PropertyChanges { target: songContainer; bottomRightRadius: 0; topRightRadius: 0 } - PropertyChanges { target: cavaContainer; bottomLeftRadius: 0; topLeftRadius: 0 } - PropertyChanges { target: song; opacity: 0 } - PropertyChanges { target: cava; opacity: 0 } - PropertyChanges { - target: popupRect - width: 700 - height: 500 - opacity: 1 - border.color: Flexoki.ui2 - } - } - ] - - transitions: [ - Transition { - from: "popup-closed" - to: "popup-open" - - SequentialAnimation { - // show immediately so mouseleave works - PropertyAction { target: popup; property: "visible" } - - ParallelAnimation { - NumberAnimation { - target: songContainer - properties: "bottomRightRadius,topRightRadius" - duration: root.contractAnimDuration - easing.type: Easing.InQuad - } - - NumberAnimation { - target: cavaContainer - properties: "bottomLeftRadius,topLeftRadius" - duration: root.contractAnimDuration - easing.type: Easing.InQuad - } - - NumberAnimation { - target: musicRow - property: "spacing" - duration: root.contractAnimDuration - easing.type: Easing.OutQuad - } - - NumberAnimation { - targets: [song, cava] - property: "opacity" - duration: root.contractAnimDuration - easing.type: Easing.OutQuad - } - } - - PropertyAction { target: popupRect; property: "opacity" } - PropertyAction { target: musicRow; property: "visible" } - - ParallelAnimation { - NumberAnimation { - target: popupRect - property: "width" - duration: 250 - easing.type: Easing.OutQuad - } - - SpringAnimation { - target: popupRect - property: "height" - spring: 5 - mass: 0.5 - damping: 0.2 - epsilon: 0.25 - } - - ColorAnimation { - target: popupRect - property: "border.color" - duration: 250 - easing.type: Easing.OutQuad - } - } - } - }, - Transition { - // TODO: this transition flickers sometimes - from: "popup-open" - to: "popup-closed" - - SequentialAnimation { - ParallelAnimation { - NumberAnimation { - target: popupRect - property: "width" - duration: 250 - easing.type: Easing.OutQuad - } - - NumberAnimation { - target: popupRect - property: "height" - duration: 250 - easing.type: Easing.OutQuad - } - - ColorAnimation { - target: popupRect - property: "border.color" - duration: 250 - easing.type: Easing.OutQuad - } - } - - PropertyAction { target: musicRow; property: "visible" } - PropertyAction { target: popup; properties: "visible" } - PropertyAction { target: popupRect; property: "opacity" } - - ParallelAnimation { - NumberAnimation { - target: songContainer - properties: "bottomRightRadius,topRightRadius" - duration: root.contractAnimDuration - easing.type: Easing.InQuad - } - - NumberAnimation { - target: cavaContainer - properties: "bottomLeftRadius,topLeftRadius" - duration: root.contractAnimDuration - easing.type: Easing.InQuad - } - - NumberAnimation { - target: musicRow - property: "spacing" - duration: root.contractAnimDuration - easing.type: Easing.OutQuad - } - - NumberAnimation { - targets: [song, cava] - property: "opacity" - duration: root.contractAnimDuration - easing.type: Easing.OutQuad - } - } - } - }, - ] - - PopupWindow { - id: popup - anchor.item: root - anchor.rect.x: root.width / 2 - width / 2 - anchor.rect.y: 0 - implicitWidth: 1920 - implicitHeight: 600 - color: "transparent" - visible: false - - - Rectangle { - id: popupRect - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: parent.top - color: Flexoki.bg - border.width: 2 - radius: 18 - - MouseArea { - anchors.fill: parent - hoverEnabled: true - onExited: root.state = "popup-closed" - } - - RowLayout { - id: popupContent - - anchors.fill: parent - anchors.topMargin: 32 - anchors.bottomMargin: 32 - anchors.leftMargin: 100 - anchors.rightMargin: 100 - spacing: 60 - - Image { - id: cover - asynchronous: true - source: "file://" + Song.coverPath - sourceSize.width: 300 - sourceSize.height: 300 - width: 300 - height: 300 - - Connections { - target: Song - - function onCoverLoaded() { - cover.source = "file://" + Song.coverPath - } - } - } - - ColumnLayout { - Text { - Layout.alignment: Qt.AlignHCenter - color: Flexoki.re - text: Song.artist - font.pixelSize: root.fontSize - } - Text { - Layout.alignment: Qt.AlignHCenter - color: Flexoki.tx - text: Song.album - font.pixelSize: root.fontSize - } - Text { - Layout.alignment: Qt.AlignHCenter - color: Flexoki.tx - text: Song.title - font.pixelSize: root.fontSize - } - } - } - } - } - - Row { - id: musicRow - anchors.centerIn: parent - height: parent.height - spacing: 4 - - Rectangle { - id: songContainer - implicitWidth: song.implicitWidth + 16*2 - height: parent.height - color: Flexoki.bg - - bottomLeftRadius: 18 - topLeftRadius: 18 - bottomRightRadius: 4 - topRightRadius: 4 - - Text { - id: song - anchors.centerIn: parent - text: { - if (!Song.file) return "Not playing" - var text = Song.file - if (Song.title) { - if (Song.artist) { - text = Song.artist + " – " + Song.title - } else { - text = Song.title - } - } - if (text.length > 60) { - text = text.substring(0, 60) + "…" - } - return text - } - color: Flexoki.tx - font { family: root.fontFamily; pixelSize: root.fontSize } - } - } - - Rectangle { - id: cavaContainer - implicitWidth: cava.implicitWidth + 16*2 - height: parent.height - color: Flexoki.bg - - bottomLeftRadius: 4 - topLeftRadius: 4 - bottomRightRadius: 18 - topRightRadius: 18 - - Row { - id: cava - anchors.centerIn: parent - height: 15 + 4 - spacing: 2 - - Repeater { - model: Cava.heights - - delegate: Rectangle { - required property int modelData - y: 15 - modelData - width: 8 - height: modelData + 4 - radius: 4 - color: Flexoki.tx - - Behavior on height { - NumberAnimation { duration: 1000 / 30; easing.type: Easing.Linear } - } - Behavior on y { - NumberAnimation { duration: 1000 / 30; easing.type: Easing.Linear } - } - } - } - } - } - } -} diff --git a/.config/quickshell/Modules/MusicPopup.qml b/.config/quickshell/Modules/MusicPopup.qml new file mode 100644 index 0000000..35a3094 --- /dev/null +++ b/.config/quickshell/Modules/MusicPopup.qml @@ -0,0 +1,52 @@ +import Quickshell +import QtQuick +import QtQuick.Layouts +import qs.Services + +RowLayout { + anchors.fill: parent + anchors.topMargin: 32 + anchors.bottomMargin: 32 + anchors.leftMargin: 100 + anchors.rightMargin: 100 + spacing: 60 + + Image { + id: cover + asynchronous: true + source: "file://" + Song.coverPath + sourceSize.width: 300 + sourceSize.height: 300 + width: 300 + height: 300 + + Connections { + target: Song + + function onCoverLoaded() { + cover.source = "file://" + Song.coverPath + } + } + } + + ColumnLayout { + Text { + Layout.alignment: Qt.AlignHCenter + color: Flexoki.re + text: Song.artist + font.pixelSize: root.fontSize + } + Text { + Layout.alignment: Qt.AlignHCenter + color: Flexoki.tx + text: Song.album + font.pixelSize: root.fontSize + } + Text { + Layout.alignment: Qt.AlignHCenter + color: Flexoki.tx + text: Song.title + font.pixelSize: root.fontSize + } + } +} diff --git a/.config/quickshell/Modules/Wall.qml b/.config/quickshell/Modules/Wall.qml index b585c2e..213632a 100644 --- a/.config/quickshell/Modules/Wall.qml +++ b/.config/quickshell/Modules/Wall.qml @@ -29,6 +29,7 @@ Variants { ColumnLayout { x: 32 y: 80 + spacing: 8 Text { text: Qt.formatDateTime(Time.time, "hh:mm") @@ -36,6 +37,12 @@ Variants { font { family: root.fontFamily; weight: 800; pixelSize: root.fontSize * 7 } } + Text { + text: Qt.formatDateTime(Time.time, "dddd") + color: Flexoki.bg + font { family: root.fontFamily; weight: 300; pixelSize: root.fontSize * 3 } + } + Text { text: Qt.formatDateTime(Time.time, "MMMM d, yyyy") color: Flexoki.bg diff --git a/.config/quickshell/Services/Uptime.qml b/.config/quickshell/Services/Uptime.qml index 155be44..b406921 100644 --- a/.config/quickshell/Services/Uptime.qml +++ b/.config/quickshell/Services/Uptime.qml @@ -44,10 +44,12 @@ Singleton { if (hours > 0) { uptime += hours + " hour" if (hours != 1) uptime += "s" - uptime += ", " + if (days == 0) uptime += ", " + } + if (days == 0) { + uptime += minutes + " minute" + if (minutes != 1) uptime += "s" } - uptime += minutes + " minute" - if (minutes != 1) uptime += "s" root.uptime = uptime } diff --git a/.config/quickshell/Services/Wifi.qml b/.config/quickshell/Services/Wifi.qml index c8fd54b..b116879 100644 --- a/.config/quickshell/Services/Wifi.qml +++ b/.config/quickshell/Services/Wifi.qml @@ -15,6 +15,10 @@ Singleton { stdout: StdioCollector { onStreamFinished: { var line = this.text.split("\n").find(line => line.includes(">")) + if (!line) { + root.ssid = "" + return + } // remove ANSI escape sequences line = line.replace(/\x1b\[.*?[@A-Z\[\\\]^_`a-z\{\|\}~]/g, '') root.ssid = line.split(" ").filter(x => x != "")[1] -- cgit v1.2.3