WIP cava process
This commit is contained in:
@@ -3,4 +3,5 @@ exec-once = /usr/bin/qs & # quickshell
|
|||||||
# exec-once = hyprpaper # wallpaper
|
# exec-once = hyprpaper # wallpaper
|
||||||
exec-once = awww-daemon # wallpaper
|
exec-once = awww-daemon # wallpaper
|
||||||
exec-once = hyprsunset # night light
|
exec-once = hyprsunset # night light
|
||||||
exec-once = qs -c overview # workspace switcher https://github.com/Shanu-Kumawat/quickshell-overview
|
exec-once = qs -c overview # workspace switcher https://github.com/Shanu-Kumawat/quickshell-overview
|
||||||
|
exec-once = cava -p ~/.config/cava/config
|
||||||
26
quickshell/services/CavaService.qml
Normal file
26
quickshell/services/CavaService.qml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
signal cavaDataChanged(string data)
|
||||||
|
|
||||||
|
// Process {
|
||||||
|
// id: cavaProcess
|
||||||
|
// command: ["cat", "/tmp/cava.fifo"]
|
||||||
|
|
||||||
|
// stdout: StdioCollector {
|
||||||
|
// waitForEnd: false
|
||||||
|
// onStreamFinished: {
|
||||||
|
// console.log("Cava data: " + this.text)
|
||||||
|
// root.cavaDataChanged(this.text)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
cavaProcess.running = true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,13 +3,20 @@ import QtQuick
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
import "../constants"
|
import "../constants"
|
||||||
|
import "../services"
|
||||||
Row {
|
Row {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property string artist: ""
|
property string artist: ""
|
||||||
property string title: ""
|
property string title: ""
|
||||||
property string artUrl: ""
|
property string artUrl: ""
|
||||||
|
property int maxTextLength: 50
|
||||||
|
|
||||||
|
// if the artist - title text is too long, truncate it
|
||||||
|
readonly property string displayText: {
|
||||||
|
const fullText = artist !== "" ? (artist + " - " + title) : title
|
||||||
|
return fullText.length > maxTextLength ? fullText.substring(0, maxTextLength - 3) + "..." : fullText
|
||||||
|
}
|
||||||
|
|
||||||
visible: title !== ""
|
visible: title !== ""
|
||||||
spacing: 6
|
spacing: 6
|
||||||
@@ -26,6 +33,14 @@ Row {
|
|||||||
// anchors.fill: parent
|
// anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CavaService {
|
||||||
|
id: cavaService
|
||||||
|
onCavaDataChanged: {
|
||||||
|
// TODO update the canvas with the new data
|
||||||
|
// console.log("Cava data changed: " + data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
width: 18
|
width: 18
|
||||||
height: 18
|
height: 18
|
||||||
@@ -35,11 +50,10 @@ Row {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: root.artist !== "" ? (root.artist + " - " + root.title) : root.title
|
text: root.displayText
|
||||||
color: Colors.md3.primary
|
color: Colors.md3.primary
|
||||||
font.family: Constants.fontFamily
|
font.family: Constants.fontFamily
|
||||||
font.pixelSize: Constants.fontSize
|
font.pixelSize: Constants.fontSize
|
||||||
elide: Text.ElideRight
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
z: 1
|
z: 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user