diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2023-04-06 23:12:47 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2023-04-06 23:12:47 +0800 |
commit | 6eb996c031841182eedf6e3dc25a343906ae55a8 (patch) | |
tree | 62d6c23c9bbc26fbe288dc28424ce3821aebbb87 | |
parent | e78991f3d49aa26675d70b6188cd4a23ef231cc9 (diff) |
Update
-rwxr-xr-x | X11/show_timer.sh | 6 | ||||
-rwxr-xr-x | bin/task/context (renamed from bin/task/context_spend_time.sh) | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/X11/show_timer.sh b/X11/show_timer.sh index dfe3dd2..dd6d877 100755 --- a/X11/show_timer.sh +++ b/X11/show_timer.sh | |||
@@ -3,11 +3,13 @@ | |||
3 | origin="$(xdotool getactivewindow)" | 3 | origin="$(xdotool getactivewindow)" |
4 | export origin | 4 | export origin |
5 | 5 | ||
6 | # If timer is set, focus to it | 6 | # If timer is set, focus to it and exit |
7 | xdotool search --name "TIMER" windowactivate && exit 0 | 7 | xdotool search --name "TIMER" windowactivate && exit 0 |
8 | 8 | ||
9 | # Add new window for a timer | 9 | # Add new window for a timer |
10 | # Use SIGINT | 10 | # Use SIGINT to toggle each mode |
11 | # Use xdotool to reactivate original window user focus | ||
12 | # After timer is closed or finished, append time into context file | ||
11 | alacritty --title TIMER --hold \ | 13 | alacritty --title TIMER --hold \ |
12 | -o "window.dimensions.columns=8" \ | 14 | -o "window.dimensions.columns=8" \ |
13 | -o "window.dimensions.lines=1" \ | 15 | -o "window.dimensions.lines=1" \ |
diff --git a/bin/task/context_spend_time.sh b/bin/task/context index 8da42c7..d81573b 100755 --- a/bin/task/context_spend_time.sh +++ b/bin/task/context | |||
@@ -26,6 +26,6 @@ else | |||
26 | # Print times for each context | 26 | # Print times for each context |
27 | while read -r ctx sec; do | 27 | while read -r ctx sec; do |
28 | echo -ne "$ctx\t" | 28 | echo -ne "$ctx\t" |
29 | date -u -d @"$sec" +%H:%M:%S | 29 | date -u -d @"$sec" +%H:%M |
30 | done <$LOG_FILE | 30 | done <$LOG_FILE |
31 | fi | 31 | fi |