|
|
@@ -7,7 +7,9 @@ getpos() {
|
|
7
|
7
|
local h
|
|
8
|
8
|
local m
|
|
9
|
9
|
local s
|
|
10
|
|
- s=$(qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.PositionGet)
|
|
|
10
|
+ local ms
|
|
|
11
|
+ ms=$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Position)
|
|
|
12
|
+ s=$((ms/1000))
|
|
11
|
13
|
s=$((s/1000))
|
|
12
|
14
|
h=$((s/3600))
|
|
13
|
15
|
s=$((s%3600))
|
|
|
@@ -35,8 +37,8 @@ mktext() {
|
|
35
|
37
|
local color_attr
|
|
36
|
38
|
local cache
|
|
37
|
39
|
cache=$(mktemp -t cstatus.GetMetadata.XXXXXXXX)
|
|
38
|
|
- qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.GetMetadata >"$cache"
|
|
39
|
|
- case $(qdbus org.mpris.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlaybackStatus) in
|
|
|
40
|
+ qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata >"$cache"
|
|
|
41
|
+ case $(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlaybackStatus) in
|
|
40
|
42
|
Stopped) sigil=""; sigilcolor= ;;
|
|
41
|
43
|
Playing) sigil=""; sigilcolor=green ;;
|
|
42
|
44
|
Paused) sigil=""; sigilcolor=gray;;
|
|
|
@@ -44,14 +46,14 @@ mktext() {
|
|
44
|
46
|
esac
|
|
45
|
47
|
test -n "$sigilcolor" && color_attr=" color='$sigilcolor'"
|
|
46
|
48
|
while read -r line; do
|
|
47
|
|
- key=${line%%:*}
|
|
|
49
|
+ key=${line%%: *}
|
|
48
|
50
|
value=${line#$key: }
|
|
49
|
51
|
case $key in
|
|
50
|
|
- artist) artist=$value ;;
|
|
51
|
|
- year) year=$value ;;
|
|
52
|
|
- album) album=$value ;;
|
|
53
|
|
- tracknumber) tracknumber=$value ;;
|
|
54
|
|
- title) title=$value ;;
|
|
|
52
|
+ xesam:artist) artist=$value ;;
|
|
|
53
|
+ year) year=$value ;;
|
|
|
54
|
+ xesam:album) album=$value ;;
|
|
|
55
|
+ xesam:trackNumber) tracknumber=$value ;;
|
|
|
56
|
+ xesam:title) title=$value ;;
|
|
55
|
57
|
esac
|
|
56
|
58
|
done <"$cache"
|
|
57
|
59
|
printf "%s [%d %s]: %02d %s (%s) <span%s>%s</span>" \
|