slack script: redirect sound to null

This commit is contained in:
thomasabishop 2025-02-22 14:21:31 +00:00
parent f049e72130
commit 1d944cc6ec

View file

@ -63,7 +63,9 @@ ERROR_BLOCKS=$(
)
# Initialise sound playback
mpv --volume=0 --start=0 --length=0.1 "${HOME}/dotfiles/gruvbox-95/sounds/st-computer-on.mp3"
mpv --volume=0 --start=0 --length=0.1 "${HOME}/dotfiles/sounds/star-trek-computer-success.mp3" \
>/dev/null 2>&1
sleep 1
# Process notification
@ -72,11 +74,14 @@ if [ "$2" != "error" ]; then
-H 'Content-type: application/json' \
--data '{"text":"🟢 '"$3"'"}' \
"$WEBHOOK"
mpv --volume=100 "${HOME}/dotfiles/sounds/star-trek-computer-success.mp3"
mpv --volume=100 "${HOME}/dotfiles/sounds/star-trek-computer-success.mp3" \
>/dev/null 2>&1
else
curl -X POST \
-H 'Content-type: application/json' \
--json "$ERROR_BLOCKS" \
"$WEBHOOK"
mpv --volume=100 "${HOME}/dotfiles/sounds/star-trek-computer-error.mp3"
mpv --volume=100 "${HOME}/dotfiles/sounds/star-trek-computer-error.mp3" \
>/dev/null 2>&1
fi