dots


commit
8775ee5
parent
aed276b
author
xxwhirlpool
date
2026-03-26 12:21:53 -0400 EDT
sounds, sfx, boop
5 files changed,  +35, -0
M config/.bashrc-laptop
+11, -0
 1@@ -215,6 +215,17 @@ mkcd() {
 2   mkdir -p "$@" && cd "$_" || exit 1;
 3 }
 4 
 5+# shamelessly stolen from evan hahn:
 6+# https://evanhahn.com/scripts-i-wrote-that-i-use-all-the-time/#audio-and-video-and-pictures
 7+boop() {
 8+	local last="$?"
 9+	if [[ "$last" == "0" ]]; then
10+		sfx chime
11+	else
12+		sfx bad
13+	fi
14+	eval "$(exit "$last")"
15+}
16 
17 ######################################
18 # misc
A config/.local/bin/sfx
+24, -0
 1@@ -0,0 +1,24 @@
 2+#!/usr/bin/env bash
 3+
 4+play_cmd="paplay"
 5+sfx_path="/home/kat/dotfiles/misc/sounds"
 6+
 7+tunes=(
 8+	"bad" # 1
 9+	"chime" # 2
10+	"ding" # 3
11+	"tada" # 4
12+	"twinkle" # 5
13+)
14+
15+for ((i=0, v=1; i < "${#tunes[@]}"; i++, v++ )); do
16+	declare "sfx$v"="$sfx_path/${tunes[$i]}"
17+done
18+
19+case "$1" in
20+	"bad") "$play_cmd" "$sfx1";;
21+	"chime") "$play_cmd" "$sfx2";;
22+	"ding") "$play_cmd" "$sfx3";;
23+	"tada") "$play_cmd" "$sfx4";;
24+	"twinkle") "$play_cmd" "$sfx5";;
25+esac
A misc/sounds/bad
+0, -0
A misc/sounds/ding
+0, -0
A misc/sounds/tada
+0, -0