diff options
author | Guillermo Ramos | 2021-07-29 21:44:38 +0200 |
---|---|---|
committer | Guillermo Ramos | 2021-07-29 21:44:38 +0200 |
commit | 875ea37016e64e57ea889d5d35000098a3a5625e (patch) | |
tree | 2f5b51c6b5dd3d932dbfe6880fe6cf8653406d31 | |
parent | e8cf241594e263767794e36c005c35a8b72a9856 (diff) | |
download | cli-875ea37016e64e57ea889d5d35000098a3a5625e.tar.gz |
gromo: Add file to indicate wip
-rwxr-xr-x | gromo | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -12,6 +12,7 @@ STOP_SECONDS=20 DATA_DIR=${XDG_DATA_HOME:-$HOME/.local/share}/gromo TODAY_FILE=$DATA_DIR/$(date -I) DING_FILE=${XDG_CACHE_HOME:-$HOME/.cache}/gromo/ding.opus +WORKING_FILE=$DATA_DIR/working mkdir -p "$DATA_DIR" @@ -21,11 +22,17 @@ gromos=0 [ -f "$TODAY_FILE" ] && read -r gromos < "$TODAY_FILE" echo "Gromos today: $gromos" +trap "rm -f $WORKING_FILE; exit" INT TERM EXIT +rm -f $WORKING_FILE + while true; do read -rn1 -p "Press any key to start gromo > " - echo -ne "\r \r" + echo -ne "\r\033[K" + touch $WORKING_FILE sleep $GROMO_SECONDS + rm -f $WORKING_FILE + gromos=$((gromos+1)) seconds=$((gromos * GROMO_SECONDS)) echo "$gromos" > "$TODAY_FILE" |