Created
November 27, 2022 20:48
-
-
Save rockerBOO/f6d65437c236a16161ced85437c984d7 to your computer and use it in GitHub Desktop.
Example running sound effect based on the exit code of a command. Customize to taste.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
success_sound="$HOME/code/audio-player/creamy2.ogg" | |
failure_sound="$HOME/code/audio-player/output.ogg" | |
# https://github.com/rockerBOO/audio-player | |
player="$HOME/code/audio-player/target/release/audio-player" | |
cargo build "$@" | |
last_run=$? | |
if [ $last_run == 0 ]; then | |
$player --volume 0.2 "$success_sound" & | |
else | |
$player --volume 0.2 --speed 2 "$failure_sound" & | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment