Tool that plays sounds based on a given string. If the string matches a user defined regex, the corresponding sound will be played.
This can be used to play sounds for terminal commands, e.g. when you type git push,
a sound will be played if you have configured a sound with a regex like git push.*.
- Odin compiler
- Clone repository
- Run
./releasescript to build the executable - Move the
termsfxbinary to a directory in your PATH or add the./build/directory to your PATH
You could also add an alias to your shell configuration:alias termsfx='~/path/to/termsfx/build/termsfx'
mkdir -p ~/.config/termsfx
touch ~/.config/termsfx/termsfx.jsonc# Example folder contents
~/.config/termsfx/
- kill.mp3
- npm.mp3
- sl.mp3
- termsfx.jsonc
- whoami.wav
- git/
- git_commit.wav
- git_commit_alternate.mp3
- git_push.mp3
Usage: termsfx [options] [command]
Options:
--config, -c <path> Specify the config file path
--no-output, -no Supress output to stdout/stderr
Commands:
play "<lookup>" Play a sound based on the lookup string
help, --help, -h Show this help messageExample:
# Play the sound for the regex "git push.*"
termsfx play "git push --force"# ~/.zshrc
preexec() {
# $1 contains the command as typed by the user
if [[ -n "$1" ]]; then
# Pass the command to termsfx
(termsfx --no-output play "$1" &) >/dev/null 2>&1
fi
}# Typing `git push` in the terminal will now automatically play the sound
# configured for the regex "git push.*"
git push