From 18fcaf66d76c6554c007cadef655128ac99dc14f Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Mon, 10 Apr 2023 20:44:25 +0800 Subject: Update --- X11/show_timer.sh | 2 +- bin/task/context | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/X11/show_timer.sh b/X11/show_timer.sh index 149b11a..93481e0 100755 --- a/X11/show_timer.sh +++ b/X11/show_timer.sh @@ -5,7 +5,7 @@ export origin # If --context is set, apply exit command and different color if echo "$@" | grep -qs '\--context'; then - COMMAND_EXIT='~/helper/bin/task/context $count' + COMMAND_EXIT='~/helper/bin/task/context ${count}s' export COLOR=33 fi diff --git a/bin/task/context b/bin/task/context index 6e48df3..44193d0 100755 --- a/bin/task/context +++ b/bin/task/context @@ -8,7 +8,7 @@ LOG_FILE=~/log/.context && touch $LOG_FILE PLAN_FILE=~/log/plan.context.md context="$(cat ~/.task/context)" -[[ "$@" =~ '-s' ]] && SET=true && shift +[[ "$*" =~ '-s' ]] && SET=true && shift time="$1" # The unit of time display. For example: @@ -76,6 +76,8 @@ _print_spend_time() { # Print context and time I spend echo -ne "$ctx\t\t" date -u -d @"$sec" +%H:%M | tr -d '\n' + echo -n "/" + date -u -d @"$seconds_of_plan" +%H:%M | tr -d '\n' number_of_spend=$(( $sec / $UNIT )) # Print block of time spend (green) -- cgit v1.2.3-70-g09d2