mpd2nheko: simplify
This commit is contained in:
parent
c14c729ede
commit
deebf1e311
|
@ -7,18 +7,9 @@ setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL
|
|||
local oldstatus
|
||||
|
||||
while :; do
|
||||
local title=$(mpc current --format '%title%')
|
||||
if [[ -z ${title} ]]; then
|
||||
dbus-send --print-reply \
|
||||
--dest=im.nheko.Nheko / im.nheko.Nheko.setStatusMessage \
|
||||
"string:"
|
||||
sleep 10s
|
||||
continue
|
||||
fi
|
||||
local artist=$(mpc current --format '%albumartist%')
|
||||
local album=$(mpc current --format '%album%')
|
||||
local mpdstatus=$(mpc current --format \
|
||||
'[np: %title%[ by [%albumartist%|%artist%][ \[from %album%\]]]]')
|
||||
|
||||
local mpdstatus="np: ${title} by ${artist} [from ${album}]"
|
||||
if [[ ${mpdstatus} != ${oldstatus} ]]; then
|
||||
dbus-send --print-reply \
|
||||
--dest=im.nheko.Nheko / im.nheko.Nheko.setStatusMessage \
|
||||
|
@ -26,5 +17,9 @@ while :; do
|
|||
oldstatus=${mpdstatus}
|
||||
fi
|
||||
|
||||
if [[ -z ${mpdstatus} ]]; then
|
||||
sleep 10
|
||||
else
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue
Block a user