Improve patterns once again

This commit is contained in:
Alex 2020-07-19 01:35:17 +02:00
parent 110ce306a1
commit 6db1cab946
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
1 changed files with 1 additions and 1 deletions

View File

@ -1,5 +1,5 @@
local REPLY
zsocket ~/.mpvsock 2>&1 >/dev/null || return
typeset -ga _cprompts_mpv=($REPLY)
_cprompts_mpv[2]="${${$(print -u $_cprompts_mpv[1] '{ "command": ["get_property", "media-title"] }' && read -Eu $_cprompts_mpv[1])#*\"data\"[[:space:]]#:[[:space:]]#\"}%%\"[[:space:]]#(,|\})*}"
_cprompts_mpv[2]="${${$(print -u $_cprompts_mpv[1] '{ "command": ["get_property", "media-title"] }' && read -Eu $_cprompts_mpv[1])#*\"data\"([^[:print:]])#:([^[:print:]])#\"}%%(\"~\\\")*}"
[ -z $_cprompts_mpv[2] ] || p10k segment -b magenta -i '' -t "${_cprompts_mpv[2]:0:20}$([ ${#_cprompts_mpv[2]} -gt 20 ] && print ...)"