Show artist if we have info about them, expand size limit
This commit is contained in:
parent
de6c28f50d
commit
384ee7d385
|
@ -79,6 +79,6 @@ function prompt_mpv_mpris() {
|
|||
typeset -g _cprompts_mpv
|
||||
local busout="$(busctl get-property -j --no-pager --timeout=300ms --user org.mpris.MediaPlayer2.mpv /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player Metadata 2>/dev/null)"
|
||||
[ -z $busout ] && return
|
||||
_cprompts_mpv="$(print $busout | jq -er '.data."xesam:title".data // empty')"
|
||||
[ -z $_cprompts_mpv ] || p10k segment -b magenta -i '' -t "${_cprompts_mpv:0:25}$([ ${#_cprompts_mpv} -gt 25 ] && print ...)"
|
||||
_cprompts_mpv="$(print $busout | jq -er '((.data."xesam:artist".data[0] // empty) + " - " + (.data."xesam:title".data // empty))')"
|
||||
[ -z $_cprompts_mpv ] || p10k segment -b magenta -i '' -t "${_cprompts_mpv:0:40}$([ ${#_cprompts_mpv} -gt 40 ] && print ...)"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue