31 lines
828 B
QML
31 lines
828 B
QML
import Quickshell.Services.Mpris
|
|
import Quickshell.Widgets
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import qs
|
|
import qs.widgets
|
|
|
|
WrapperRectangle {
|
|
id: root
|
|
property MprisPlayer spotify: findSpotify()
|
|
required property int barHeight
|
|
property double vertMargin: barHeight / 4 - 4
|
|
visible: spotify != null
|
|
topMargin: vertMargin
|
|
bottomMargin: vertMargin
|
|
leftMargin: 8
|
|
rightMargin: 8
|
|
color: Colors.base01
|
|
function findSpotify() {
|
|
for (let i = 0; i < Mpris.players.values.length; i++) {
|
|
let current = Mpris.players.values[i];
|
|
if (current.identity == 'spotify' || 'Spotify') {
|
|
return current;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
StyledText {
|
|
text: root.spotify?.trackTitle + " - " + root.spotify?.trackArtists
|
|
}
|
|
}
|