mpris
This commit is contained in:
parent
653f5814b3
commit
2852735d70
4 changed files with 96 additions and 0 deletions
29
modules/bar/components/Mpris.qml
Normal file
29
modules/bar/components/Mpris.qml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import Quickshell
|
||||
import Quickshell.Services.Mpris
|
||||
import QtQuick
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property int currentIndex: 0
|
||||
|
||||
implicitWidth: childrenRect.width
|
||||
implicitHeight: childrenRect.height
|
||||
|
||||
Repeater {
|
||||
id: players
|
||||
model: Mpris.players.values.filter(item => item != null)
|
||||
|
||||
Player {
|
||||
|
||||
visible: index === root.currentIndex && modelData.canControl
|
||||
|
||||
onNextPlayer: {
|
||||
currentIndex = (currentIndex + 1) % players.count;
|
||||
}
|
||||
onPreviousPlayer: {
|
||||
currentIndex = (currentIndex - 1 + players.count) % players.count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue