X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=home%2Flib%2Flogin_functions.sh;h=862e908a0078d92a2160baa40443716691e2efb5;hb=201141404a46ff322acbc4856a32311923f58a29;hp=2a244138dc0dc08bb219a927e454e92e507d4b12;hpb=8aa18398a5d46124648cdcfe7bdc742f66620627;p=khome.git diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index 2a24413..862e908 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -82,7 +82,7 @@ experiment() { } hump() { - ledit -l $(stty size | awk '{print $2}') ocaml $@ + ledit -l "$(stty size | awk '{print $2}')" ocaml $@ } howto() { @@ -119,7 +119,6 @@ gh_clone_repo() { mkdir -p "$gh_dir" cd "$gh_dir" || exit 1 git clone "$1" - cd - || exit 1 } work_log_template() { @@ -167,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" +}