diff options
Diffstat (limited to 'X11/show_timer.sh')
-rwxr-xr-x | X11/show_timer.sh | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/X11/show_timer.sh b/X11/show_timer.sh index dd6d877..149b11a 100755 --- a/X11/show_timer.sh +++ b/X11/show_timer.sh | |||
@@ -3,6 +3,12 @@ | |||
3 | origin="$(xdotool getactivewindow)" | 3 | origin="$(xdotool getactivewindow)" |
4 | export origin | 4 | export origin |
5 | 5 | ||
6 | # If --context is set, apply exit command and different color | ||
7 | if echo "$@" | grep -qs '\--context'; then | ||
8 | COMMAND_EXIT='~/helper/bin/task/context $count' | ||
9 | export COLOR=33 | ||
10 | fi | ||
11 | |||
6 | # If timer is set, focus to it and exit | 12 | # If timer is set, focus to it and exit |
7 | xdotool search --name "TIMER" windowactivate && exit 0 | 13 | xdotool search --name "TIMER" windowactivate && exit 0 |
8 | 14 | ||
@@ -11,13 +17,13 @@ xdotool search --name "TIMER" windowactivate && exit 0 | |||
11 | # Use xdotool to reactivate original window user focus | 17 | # Use xdotool to reactivate original window user focus |
12 | # After timer is closed or finished, append time into context file | 18 | # After timer is closed or finished, append time into context file |
13 | alacritty --title TIMER --hold \ | 19 | alacritty --title TIMER --hold \ |
14 | -o "window.dimensions.columns=8" \ | 20 | -o window.dimensions.columns=8 \ |
15 | -o "window.dimensions.lines=1" \ | 21 | -o window.dimensions.lines=1 \ |
16 | -o "window.position.x=-0" \ | 22 | -o window.position.x=-0 \ |
17 | -o "window.position.y=0" \ | 23 | -o window.position.y=0 \ |
18 | -o "window.opacity=0.6" \ | 24 | -o window.opacity=0.6 \ |
19 | -o "font.size=40" \ | 25 | -o font.size=40 \ |
20 | -e "$HOME"/helper/bin/unix/timer.sh \ | 26 | -e ~/helper/bin/unix/timer.sh \ |
21 | SIGINT \ | 27 | SIGINT \ |
22 | "xdotool windowactivate $origin" \ | 28 | "xdotool windowactivate $origin" \ |
23 | '~/helper/bin/task/context_spend_time.sh $count' | 29 | "$COMMAND_EXIT" |