Commit 89c03b25 authored by nimrod's avatar nimrod
Browse files

Revert some recent sudo and monitor changes, didn't work well.

parent 8704ede9
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -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 ]

Documents/bin/monitor

deleted100755 → 0
+0 −11
Original line number Diff line number Diff line
#!/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