5 lines
346 B
Plaintext
5 lines
346 B
Plaintext
zsocket ~/.mpvsock
|
|
typeset -ga _cprompts_mpv=($REPLY)
|
|
_cprompts_mpv[2]="${${$(print -u $_cprompts_mpv[1] '{ "command": ["get_property", "media-title"] }' && read -Eu $_cprompts_mpv[1])#*\"data\"*:*\"}%%\"*}"
|
|
[ -z $_cprompts_mpv[2] ] || p10k segment -b magenta -i '' -t "${_cprompts_mpv[2]:0:20}$([ ${#_cprompts_mpv[2]} -gt 20 ] && print ...)"
|