Last active
January 16, 2020 19:07
-
-
Save shapr/fbe79e53f44e9b6d5a615bce349eb588 to your computer and use it in GitHub Desktop.
wrapper for long running commands
This file contains hidden or 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
| # for long running commands | |
| function try () { | |
| tally $* && fin || die; # cargo install tally, replacement for time | |
| } | |
| function play_sound () { | |
| aplay -N -q $HOME/.bin/$1.au | |
| } | |
| function fin () { | |
| # terminal.png should be in /usr/share/icons/gnome/32x32/apps/terminal.png | |
| notify-send "success" -i terminal # from http://manpages.ubuntu.com/manpages/eoan/man1/notify-send.1.html | |
| play_sound monkey # monkey.wav from XEmacs https://bitbucket.org/xemacs/sounds-wav/src | |
| } | |
| function die() { | |
| # error.png should be in /usr/share/icons/gnome/32x32/status/error.png | |
| notify-send "fail" -i error # from http://manpages.ubuntu.com/manpages/eoan/man1/notify-send.1.html | |
| 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