2026-03-08 13:44:57 +01:00
|
|
|
import Quickshell
|
|
|
|
|
import Quickshell.Services.Mpris
|
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import qs
|
|
|
|
|
import qs.settings
|
|
|
|
|
import qs.widgets
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: root
|
|
|
|
|
color: ThemeLoader.colors.base03
|
|
|
|
|
implicitWidth: playingSong.implicitWidth + 14
|
|
|
|
|
implicitHeight: Settings.config.barHeight / 2 + 6
|
|
|
|
|
radius: Settings.config.rounding
|
|
|
|
|
property var spotify: root.getSpotify()
|
|
|
|
|
|
|
|
|
|
function getSpotify() {
|
|
|
|
|
for (var i = 0; i < Mpris.players.values.length; i++) {
|
|
|
|
|
if (Mpris.players.values[i].identity == "spotify" || "Spotify") {
|
|
|
|
|
return Mpris.players.values[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
CText {
|
|
|
|
|
id: playingSong
|
|
|
|
|
anchors.centerIn: parent
|
2026-03-08 13:48:00 +01:00
|
|
|
text: root.spotify == null ? "" : root.spotify.trackTitle + " - " + root.spotify.trackArtist
|
2026-03-08 13:44:57 +01:00
|
|
|
}
|
|
|
|
|
}
|