Skip to content

Instantly share code, notes, and snippets.

@ManasN
Forked from ashwin/long-command-notification.sh
Last active September 1, 2015 13:26
Show Gist options
  • Save ManasN/5775f940e185c99d882e to your computer and use it in GitHub Desktop.
Save ManasN/5775f940e185c99d882e 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 * 3")
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