Notify when a command is completed, with an audio and visual warning
This commit is contained in:
parent
31e09ae48a
commit
380facca38
1 changed files with 14 additions and 1 deletions
15
.bashrc
15
.bashrc
|
|
@ -133,6 +133,19 @@ function psg() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Notify when a command is completed, with an audio and visual warning.
|
||||||
|
function notify() {
|
||||||
|
cmd="$1"
|
||||||
|
$@
|
||||||
|
if [[ $? ]] ; then
|
||||||
|
msg="Your \"$cmd\" command is completed"
|
||||||
|
else
|
||||||
|
msg="There was an error in your \"$cmd\" command"
|
||||||
|
fi
|
||||||
|
espeak -s 110 "$msg" 2>&1 > /dev/null & zenity --info --text "$msg\n\n$(date)"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
##########
|
##########
|
||||||
# Coding #
|
# Coding #
|
||||||
##########
|
##########
|
||||||
|
|
@ -205,7 +218,7 @@ echo "tree : nice alternative to 'ls'"
|
||||||
echo "ff [pattern] : find a file with a pattern in name"
|
echo "ff [pattern] : find a file with a pattern in name"
|
||||||
echo "myip : show the IP address of eth0"
|
echo "myip : show the IP address of eth0"
|
||||||
echo "repeat [n] [command] : repeat n times command"
|
echo "repeat [n] [command] : repeat n times command"
|
||||||
echo "clean : remove backip files (*~)"
|
echo "clean : remove backup files (*~)"
|
||||||
echo "psg : ps aux | grep "
|
echo "psg : ps aux | grep "
|
||||||
echo "rcp : copy with rsync/ssh"
|
echo "rcp : copy with rsync/ssh"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue