diff --git a/.bashrc b/.bashrc index 6db6c0a6a2726523674eea33e4a200b6abc430a0..4a9dac6652c540041b13ee3300853065ff06692f 100644 --- a/.bashrc +++ b/.bashrc @@ -86,7 +86,7 @@ alias gen-mac="hexdump -n5 -e '\"02\" 5/1 \":%02X\" \"\\n\"' /dev/urandom" alias clean-swp="find \$HOME/ -name '*.swp' -delete" alias unssh="ssh -o \"UserKnownHostsFile /dev/null\" -o \"StrictHostKeyChecking no\"" alias todo="vim \$HOME/Documents/TODO.yml" -alias sudo="sudo --preserve-env=PATH" +alias sudo="sudo " alias git="git " alias xargs="xargs " alias presentation='docker dev adarnimrod/presentation' @@ -95,7 +95,7 @@ alias netdata='docker run --detach --name netdata --cap-add SYS_PTRACE --volume alias newman='docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/etc/newman" -t postman/newman_alpine33' alias jt='json_tool' alias http-server='python3 -m http.server 8080' -alias dd='monitor dd status=progress' +alias dd='dd status=progress' alias screenshot-cleanup='find "$HOME/Pictures" -name "Screenshot from *.png" -delete' alias bell="printf '\a'" command -v notify-send > /dev/null || alias notify-send='bell' @@ -130,6 +130,15 @@ for line in stdin.readlines(): fi } +monitor () { + if eval "$@" + then + notify-send "$(basename ${1#__}) has finished." + else + notify-send --urgency=critical "$(basename ${1#__}) has failed." + fi +} + # shellcheck disable=SC2120 json_tool () { if [ -t 0 ] diff --git a/Documents/bin/monitor b/Documents/bin/monitor deleted file mode 100755 index 433afb726e2531bdcd54a11b4df5d347f2554fc4..0000000000000000000000000000000000000000 --- a/Documents/bin/monitor +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -set -eu - -[ "$#" -gt "0" ] || exit 0 - -if eval "$@" -then - notify-send "$(basename "${1#__}") has finished." -else - notify-send --urgency=critical "$(basename "${1#__}") has failed." -fi