summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/quickshell/Bar.qml25
-rw-r--r--.config/quickshell/Time.qml2
-rw-r--r--.config/quickshell/Uptime.qml63
-rw-r--r--.config/quickshell/Wall.qml52
-rw-r--r--.config/quickshell/cava.ini7
-rw-r--r--.config/quickshell/shell.qml1
6 files changed, 143 insertions, 7 deletions
diff --git a/.config/quickshell/Bar.qml b/.config/quickshell/Bar.qml
index b7ec963..02b8781 100644
--- a/.config/quickshell/Bar.qml
+++ b/.config/quickshell/Bar.qml
@@ -1,5 +1,4 @@
import Quickshell
-import Quickshell.Io
import QtQuick
import QtQuick.Layouts
@@ -98,7 +97,13 @@ Variants {
Text {
id: song
anchors.centerIn: parent
- text: Song.artist + " - " + Song.title
+ text: {
+ var text = Song.artist + " – " + Song.title
+ if (text.length > 60) {
+ text = text.substring(0, 60) + "…"
+ }
+ return text
+ }
color: Flexoki.tx
font { family: root.fontFamily; pixelSize: root.fontSize }
}
@@ -121,14 +126,22 @@ Variants {
spacing: 2
Repeater {
- model: 8
+ model: Cava.heights
delegate: Rectangle {
- y: 15 - Cava.heights[index]
+ required property int modelData
+ y: 15 - modelData
width: 8
- height: Cava.heights[index] + 4
+ 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 }
+ }
}
}
}
@@ -200,7 +213,7 @@ Variants {
}
Text {
- text: " " + Time.time
+ text: " " + Qt.formatDateTime(Time.time, "MMM d hh:mm:ss")
color: Flexoki.bl
font { family: root.fontFamily; pixelSize: root.fontSize }
}
diff --git a/.config/quickshell/Time.qml b/.config/quickshell/Time.qml
index b54b12f..7af1b1f 100644
--- a/.config/quickshell/Time.qml
+++ b/.config/quickshell/Time.qml
@@ -6,7 +6,7 @@ import QtQuick
Singleton {
id: root
- readonly property string time: Qt.formatDateTime(clock.date, "MMM d hh:mm:ss")
+ readonly property var time: clock.date
SystemClock {
id: clock
diff --git a/.config/quickshell/Uptime.qml b/.config/quickshell/Uptime.qml
new file mode 100644
index 0000000..155be44
--- /dev/null
+++ b/.config/quickshell/Uptime.qml
@@ -0,0 +1,63 @@
+pragma Singleton
+
+import Quickshell
+import Quickshell.Io
+import QtQuick
+
+Singleton {
+ id: root
+ property string uptime
+
+ Process {
+ id: uptimeProc
+ command: ["uptime"]
+ running: true
+ stdout: StdioCollector {
+ onStreamFinished: {
+ var t = this.text.trim().split(" up ")[1]
+
+ var days = 0
+ if (t.includes("day")) {
+ var [d, t] = t.split(" day")
+ days = parseInt(d.trim())
+ t = t.split(", ")[1]
+ }
+ t = t.split(", ")[0]
+
+ var hours = 0
+ var minutes = 0
+
+ if (t.includes("min")) {
+ minutes = parseInt(t.split(' min')[0])
+ } else {
+ var [h, m] = t.split(":")
+ hours = parseInt(h.trim())
+ minutes = parseInt(m.trim())
+ }
+
+ var uptime = "Up ";
+ if (days > 0) {
+ uptime += days + " day"
+ if (days != 1) uptime += "s"
+ uptime += ", "
+ }
+ if (hours > 0) {
+ uptime += hours + " hour"
+ if (hours != 1) uptime += "s"
+ uptime += ", "
+ }
+ uptime += minutes + " minute"
+ if (minutes != 1) uptime += "s"
+
+ root.uptime = uptime
+ }
+ }
+ }
+
+ Timer {
+ interval: 60000
+ running: true
+ repeat: true
+ onTriggered: uptimeProc.running = true
+ }
+}
diff --git a/.config/quickshell/Wall.qml b/.config/quickshell/Wall.qml
new file mode 100644
index 0000000..fc47161
--- /dev/null
+++ b/.config/quickshell/Wall.qml
@@ -0,0 +1,52 @@
+import Quickshell
+import QtQuick
+import QtQuick.Layouts
+
+Variants {
+ model: Quickshell.screens;
+
+ delegate: Component {
+ PanelWindow {
+ id: root
+
+ required property var modelData
+ screen: modelData
+
+ property string fontFamily: "Poppins"
+ property int fontSize: 14
+
+ anchors {
+ top: true
+ bottom: true
+ left: true
+ right: true
+ }
+ aboveWindows: false
+
+ color: "transparent"
+
+ ColumnLayout {
+ x: 32
+ y: 80
+
+ Text {
+ text: Qt.formatDateTime(Time.time, "hh:mm")
+ color: Flexoki.bg
+ font { family: root.fontFamily; weight: 800; pixelSize: root.fontSize * 7 }
+ }
+
+ Text {
+ text: Qt.formatDateTime(Time.time, "MMMM d, yyyy")
+ color: Flexoki.bg
+ font { family: root.fontFamily; weight: 300; pixelSize: root.fontSize * 2.25 }
+ }
+
+ Text {
+ text: Uptime.uptime
+ color: Flexoki.bg
+ font { family: root.fontFamily; weight: 300; pixelSize: root.fontSize * 1.75 }
+ }
+ }
+ }
+ }
+}
diff --git a/.config/quickshell/cava.ini b/.config/quickshell/cava.ini
index ce42439..353527d 100644
--- a/.config/quickshell/cava.ini
+++ b/.config/quickshell/cava.ini
@@ -1,7 +1,14 @@
[general]
framerate=30
bars=8
+
+[input]
+method=pipewire
+source=auto
+
[output]
+channels=mono
+mono_option=average
method=raw
raw_target=/dev/stdout
data_format=ascii
diff --git a/.config/quickshell/shell.qml b/.config/quickshell/shell.qml
index 6bd7760..7a27cf2 100644
--- a/.config/quickshell/shell.qml
+++ b/.config/quickshell/shell.qml
@@ -2,4 +2,5 @@ import Quickshell
Scope {
Bar {}
+ Wall {}
}