From bd3022bb047aa5570afa15b85aaad51189ba3993 Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 4 Apr 2024 13:28:40 +0200 Subject: [PATCH] add mx-update-np --- .config/zsh/functions/mx-update-np | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 .config/zsh/functions/mx-update-np diff --git a/.config/zsh/functions/mx-update-np b/.config/zsh/functions/mx-update-np new file mode 100755 index 0000000..5eadef8 --- /dev/null +++ b/.config/zsh/functions/mx-update-np @@ -0,0 +1,12 @@ +#!/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 ERR_RETURN NO_UNSET PIPE_FAIL + +local np=$(np-subsonic) +if [[ -n "${np}" ]]; then + mx-set-status "np: $(np-subsonic)" +else + mx-set-status +fi