nova-shell/modules/Mpris.qml
2026-04-12 00:37:11 +02:00

25 lines
676 B
QML

import QtQuick
import Quickshell.Services.Mpris
import "." as M
Row {
id: root
spacing: 4
visible: player !== null
readonly property MprisPlayer player: Mpris.players.values[0] ?? null
readonly property bool playing: player?.playbackState === MprisPlaybackState.Playing
M.BarIcon {
icon: root.playing ? "" : (root.player?.playbackState === MprisPlaybackState.Paused ? "󰏤" : "󰓛")
anchors.verticalCenter: parent.verticalCenter
}
M.BarLabel {
label: root.player?.identity ?? ""
anchors.verticalCenter: parent.verticalCenter
}
TapHandler {
onTapped: root.player?.togglePlaying()
}
}