33 lines
837 B
QML
33 lines
837 B
QML
import Quickshell.Services.Mpris
|
|
import Quickshell.Widgets
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import qs
|
|
import qs.widgets
|
|
import qs.settings
|
|
|
|
WrapperRectangle {
|
|
id: root
|
|
property MprisPlayer spotify: {
|
|
for (const player of Mpris.players.values) {
|
|
if (player.identity === "Spotify")
|
|
return player;
|
|
}
|
|
return null;
|
|
}
|
|
visible: spotify !== null && spotify.playbackState === MprisPlaybackState.Playing
|
|
leftMargin: 8
|
|
rightMargin: 8
|
|
color: Colors.base01
|
|
radius: Config.rounding
|
|
child: RowLayout {
|
|
MaterialIcon {
|
|
text: "music_note_2"
|
|
}
|
|
StyledText {
|
|
Layout.maximumWidth: 400
|
|
text: root.spotify?.trackTitle + " - " + root.spotify?.trackArtists
|
|
elide: Text.ElideRight
|
|
}
|
|
}
|
|
}
|