Adds old zsh functions untouched.
This commit is contained in:
18
.zsh_functions/remind
Executable file
18
.zsh_functions/remind
Executable file
@@ -0,0 +1,18 @@
|
||||
# Use like this
|
||||
# some-command && sleep 1 ; alert-me -s -t -f --success-message --success-title --failure-message --failure-title --title
|
||||
# osascript -e 'display notification "The command worked" with title "Success"'
|
||||
# osascript -e 'display notification "The command failed" with title "Failed"'
|
||||
alert-me(){
|
||||
local SUCCESS_MESSAGE="The command worked"
|
||||
local SUCCESS_TITLE="Success"
|
||||
local FAILURE_MESSAGE="The command failed"
|
||||
local FAILURE_TITLE="Failed"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
osascript -e "display notification \"$SUCCESS_MESSAGE\" with title \"$SUCCESS_TITLE\""
|
||||
else
|
||||
|
||||
osascript -e "display notification \"$FAILURE_MESSAGE\" with title \"$FAILURE_TITLE\""
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user