configs are here

This commit is contained in:
2025-07-23 19:10:20 +01:00
parent 94ad864303
commit df2a697a9b
23 changed files with 1251 additions and 2 deletions

45
quickshell_/Player.qml Normal file
View File

@@ -0,0 +1,45 @@
pragma Singleton
import Quickshell
import Quickshell.Io
import QtQuick
import Quickshell.Services.Mpris
Singleton {
id: root
// property MprisPlayer trackedPlayer: null;
readonly property MprisPlayer activePlayer: PlayerController.activePlayer.identity === "Spotify"
? PlayerController.activePlayer
: null
readonly property string time: {
root.activePlayer.trackTitle
}
readonly property string artist: {
root.activePlayer.trackArtist
}
readonly property string timetime: {
Math.floor(root.activePlayer.position / 60) + ":" +
formatTwoDigits(Math.floor(root.activePlayer.position % 60))
}
readonly property string fulltime: {
Math.floor(root.activePlayer.length / 60) + ":" +
formatTwoDigits(Math.floor(root.activePlayer.length % 60))
}
function formatTwoDigits(num) {
return (num < 10 ? "0" : "") + num;
}
Timer {
// only emit the signal when the position is actually changing.
running: root.activePlayer.playbackState == MprisPlaybackState.Playing
// Make sure the position updates at least once per second.
interval: 1000
repeat: true
// emit the positionChanged signal every second.
onTriggered: root.activePlayer.positionChanged()
}
}