commit b33c4f14f35a3c12db82a0a78b35e452d044df8f
parent cea90f72d7f560a979b9e07588cb750333291f41
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Thu, 25 Jan 2018 00:17:42 +0100
different name
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/throttle b/throttle
@@ -3,12 +3,13 @@
# make time wasters less attractive
# this is like hacker news' noprocrast setting
+NAME="$1"
+shift
BLOCK=7200
GRACE=2
WAIT=1
-COMMAND="$1"
DIR="$HOME/temp/throttle"
-FILE="$DIR/$COMMAND"
+FILE="$DIR/$NAME"
mkdir -p "$DIR"
if [ ! -f "$FILE" ]
@@ -25,7 +26,7 @@ then
HOURS=$(($DIFF/3600))
MINS=$((($DIFF%3600)/60))
SECS=$(($DIFF%60))
- echo "$USER, the last time you ran $COMMAND was ${HOURS}h ${MINS}m ${SECS}s ago"
+ echo "$USER, the last time you ran $NAME was ${HOURS}h ${MINS}m ${SECS}s ago"
echo "i'm giving you $WAIT seconds to change your mind..."
sleep $WAIT
CODE="$RANDOM"