From 0a99de182c17961a0230300fe286ae4a39ea3fdf Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sun, 27 May 2018 21:32:52 +0300
Subject: [PATCH] Revert some recent sudo and monitor changes, didn't work
 well.

---
 .bashrc               | 13 +++++++++++--
 Documents/bin/monitor | 11 -----------
 2 files changed, 11 insertions(+), 13 deletions(-)
 delete mode 100755 Documents/bin/monitor

diff --git a/.bashrc b/.bashrc
index 6db6c0a..4a9dac6 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 433afb7..0000000
--- 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
-- 
GitLab