Commit 8775ee5
xxwhirlpool
·
2026-03-26 12:21:53 -0400 EDT
parent aed276b
sounds, sfx, boop
5 files changed,
+35,
-0
+11,
-0
| ... | ... | @@ -215,6 +215,17 @@ mkcd() { | |
| 215 | 215 | mkdir -p "$@" && cd "$_" || exit 1; | |
| 216 | 216 | } | |
| 217 | 217 | ||
| 218 | + | # shamelessly stolen from evan hahn: | |
| 219 | + | # https://evanhahn.com/scripts-i-wrote-that-i-use-all-the-time/#audio-and-video-and-pictures | |
| 220 | + | boop() { | |
| 221 | + | local last="$?" | |
| 222 | + | if [[ "$last" == "0" ]]; then | |
| 223 | + | sfx chime | |
| 224 | + | else | |
| 225 | + | sfx bad | |
| 226 | + | fi | |
| 227 | + | eval "$(exit "$last")" | |
| 228 | + | } | |
| 218 | 229 | ||
| 219 | 230 | ###################################### | |
| 220 | 231 | # misc |
+24,
-0
| ... | ... | @@ -0,0 +1,24 @@ | |
| 1 | + | #!/usr/bin/env bash | |
| 2 | + | ||
| 3 | + | play_cmd="paplay" | |
| 4 | + | sfx_path="/home/kat/dotfiles/misc/sounds" | |
| 5 | + | ||
| 6 | + | tunes=( | |
| 7 | + | "bad" # 1 | |
| 8 | + | "chime" # 2 | |
| 9 | + | "ding" # 3 | |
| 10 | + | "tada" # 4 | |
| 11 | + | "twinkle" # 5 | |
| 12 | + | ) | |
| 13 | + | ||
| 14 | + | for ((i=0, v=1; i < "${#tunes[@]}"; i++, v++ )); do | |
| 15 | + | declare "sfx$v"="$sfx_path/${tunes[$i]}" | |
| 16 | + | done | |
| 17 | + | ||
| 18 | + | case "$1" in | |
| 19 | + | "bad") "$play_cmd" "$sfx1";; | |
| 20 | + | "chime") "$play_cmd" "$sfx2";; | |
| 21 | + | "ding") "$play_cmd" "$sfx3";; | |
| 22 | + | "tada") "$play_cmd" "$sfx4";; | |
| 23 | + | "twinkle") "$play_cmd" "$sfx5";; | |
| 24 | + | esac |
+0,
-0
Binaries are not rendered as diffs.
+0,
-0
Binaries are not rendered as diffs.
+0,
-0
Binaries are not rendered as diffs.