Skip to content

Instantly share code, notes, and snippets.

@KevinGimbel
Last active August 29, 2015 14:05
Show Gist options
  • Save KevinGimbel/7f6b21e229d5a2c27fe1 to your computer and use it in GitHub Desktop.
Save KevinGimbel/7f6b21e229d5a2c27fe1 to your computer and use it in GitHub Desktop.
This part placed in ~/.bashrc makes the Shell on Ubuntu capable of sending System Notifications.
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//; s/[;&|]\s*alert$//'\'')"'
#
# Example Usage:
# sudo apt-get update; alert
#
# will sent a notification when the update is finished.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment