Skip to content

Instantly share code, notes, and snippets.

@ashwin
Last active November 21, 2018 13:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ashwin/5891060 to your computer and use it in GitHub Desktop.
Save ashwin/5891060 to your computer and use it in GitHub Desktop.
Show notification in Ubuntu when long duration command finishes execution in fish shell
### Notify on long command completion
# If commands runs >= 10 seconds, notify user on completion
if test $CMD_DURATION
if test $CMD_DURATION -gt (math "1000 * 10")
set secs (math "$CMD_DURATION / 1000")
notify-send "$history[1]" "Returned $status, took $secs seconds"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment