home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
641d30d
)
Add function to run command and notify on completion
author
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 15 May 2019 15:23:16 +0000
(11:23 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 15 May 2019 15:23:16 +0000
(11:23 -0400)
home/lib/login_functions.sh
patch
|
blob
|
blame
|
history
diff --git
a/home/lib/login_functions.sh
b/home/lib/login_functions.sh
index
1cc5f7f
..
862e908
100644
(file)
--- a/
home/lib/login_functions.sh
+++ b/
home/lib/login_functions.sh
@@
-166,3
+166,16
@@
bt_devs() {
| awk '{print $2}' \
| xargs bluetoothctl -- info
}
+
+run() {
+ stderr="$(mktemp)"
+ $@ 2> >(tee "$stderr")
+ code="$?"
+ urgency=''
+ case "$code" in
+ 0) urgency='normal';;
+ *) urgency='critical'
+ esac
+ notify-send -u "$urgency" "Job done: $code" "$(cat $stderr)"
+ rm "$stderr"
+}
This page took
0.023956 seconds
and
4
git commands to generate.