aboutsummaryrefslogtreecommitdiff
path: root/ding
blob: e89cf00ebfe208839b0f62c6a7319bc32c66a1d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
#
# Usage: ding <command>
# Just play a ding when the command is finished :)
###############################################################################

CACHE_DIR=${XDG_CACHE_HOME:-$HOME/.cache}

OK_DING_URL=https://gramos.me/sounds/macos8/Indigo.ogg
OK_DING=$CACHE_DIR/indigo.ogg
[ -f "$OK_DING" ] || curl $OK_DING_URL --create-dirs -so "$OK_DING"

ERROR_DING_URL=https://gramos.me/sounds/macos8/Quack.ogg
ERROR_DING=$CACHE_DIR/quack.ogg
[ -f "$ERROR_DING" ] || curl $ERROR_DING_URL --create-dirs -so "$ERROR_DING"

"$@" && { mpv --no-terminal "$OK_DING" & } || { mpv --no-terminal "$ERROR_DING" & }