Skip to content

Instantly share code, notes, and snippets.

@shapr
Created February 7, 2021 20:49
Show Gist options
  • Select an option

  • Save shapr/5d259e00280d9f0f6936727ee99d8a20 to your computer and use it in GitHub Desktop.

Select an option

Save shapr/5d259e00280d9f0f6936727ee99d8a20 to your computer and use it in GitHub Desktop.
param confusion
# for long running commands
function try () {
bloohm "/dev/ttyACM0" Yellow $PWD:A "$*"
time $* && fin || die; # cargo install tally, replacement for time
}
function play_sound () {
aplay -N -q $HOME/.bin/$1.au
}
function fin () {
bloohm "/dev/ttyACM0" Green $PWD:A "$*"
# terminal.png should be in /usr/share/icons/gnome/32x32/apps/terminal.png
#notify-send "success" -i terminal
play_sound monkey # monkey.wav from XEmacs https://bitbucket.org/xemacs/sounds-wav/src
}
function die() {
bloohm "/dev/ttyACM0" Red $PWD:A "$*"
# error.png should be in /usr/share/icons/gnome/32x32/status/error.png
#notify-send "fail" -i error
play_sound yeep # yeep.wav from XEmacs https://bitbucket.org/xemacs/sounds-wav/src
play_sound yeep
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment