Skip to content

Instantly share code, notes, and snippets.

@liuw
Created March 18, 2019 16:35
Show Gist options
  • Save liuw/debc17c341b6dedc7c613b24843385ad to your computer and use it in GitHub Desktop.
Save liuw/debc17c341b6dedc7c613b24843385ad to your computer and use it in GitHub Desktop.
A script to run a command then notify completion
#!/bin/sh
# Uses notify-send command.
# Install ruby-notify on Debian
"$@"
ret=$?
cmd="$@"
lvl=normal
if [ $ret -ne 0 ]; then lvl=critical; fi
notify-send -u $lvl "$$" "$cmd"
exit $ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment