dotfiles/.config/zsh/functions/mx-update-np
tastytea ef891e2a35
mx-update-np: don't return on error
error is expected when nothing's playing
2024-04-04 14:43:07 +02:00

17 lines
328 B
Bash
Executable File

#!/usr/bin/env zsh
# set matrix status to subsonic now playing
# needs mx-set-status and np-subsonic in ${PATH} or as functions
setopt LOCAL_OPTIONS NO_UNSET PIPE_FAIL
local np
while sleep 10; do
np=$(np-subsonic)
if [[ -n "${np}" ]]; then
mx-set-status "np: ${np}"
else
mx-set-status
fi
done