Adds old zsh functions untouched.

This commit is contained in:
Tom Hicks
2024-09-20 17:25:20 -07:00
parent 13eeb245e3
commit ccd795ee6f
4 changed files with 42 additions and 0 deletions

18
.zsh_functions/remind Executable file
View 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
}