Convert notify-done alias to notify_done function with more features.
[khome.git] / home / lib / login_functions.sh
index 3a21209..3bf7676 100644 (file)
@@ -1,5 +1,20 @@
 #
 
+## notify_done : unit -> unit
+notify_done() {
+    local -r _status_code="$?"
+    local -r _program="$1"
+    local _timestamp
+    _timestamp="$(timestamp)"
+    local -r _msg="$_timestamp [$_program] done "
+    if [[ "$_status_code" -eq 0 ]]
+    then
+        notify-send -u normal "$_msg OK: $_status_code"
+    else
+        notify-send -u critical "$_msg ERROR: $_status_code"
+    fi
+}
+
 ## p : string -> unit
 p() {
     awk \
This page took 0.027824 seconds and 4 git commands to generate.