-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathnotify.sh
More file actions
executable file
·36 lines (32 loc) · 1 KB
/
notify.sh
File metadata and controls
executable file
·36 lines (32 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash -e
rc=$?
if [ -n "$TMUX" ]; then
msg=""
session_name=$(tmux display-message -p "#{session_name}")
window_id=$(tmux display-message -p "#{window_id}")
window_id=""
window_name=$(tmux display-message -p "#{window_name}")
msg="$PWD: ${session_name} ${window_id} ${window_name} -> rc=$rc"
else
msg="$PWD: -> rc=$rc"
fi;
echo $msg
# Play a sound.
(for i in {1..2}; do afplay -v 1.00 /System/Library/Sounds/Ping.aiff; done) &
if [[ 0 == 0 ]]; then
if [[ "$(uname)" == "Darwin" ]]; then
# brew install terminal-notifier
# cmd='Display notification "'$msg'" with title "DONE!" subtitle "Script finished" sound name "blow"'
# echo $cmd
# osascript -e "$cmd"
terminal-notifier -title "DONE" -message "Script finished" -sound "Blow"
fi;
if [ -n "$TMUX" ]; then
tmux display-message "$msg"
if [[ 0 == 1 ]]; then
for i in {1..5}; do
tmux display-message "$msg"
done
fi;
fi;
fi;