From 52af58e39af8ac006c62d1788b6672966b2a9f47 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 7 Apr 2023 12:46:42 +0800 Subject: Update --- X11/show_timer.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'X11/show_timer.sh') 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 @@ origin="$(xdotool getactivewindow)" 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' + export COLOR=33 +fi + # If timer is set, focus to it and exit xdotool search --name "TIMER" windowactivate && exit 0 @@ -11,13 +17,13 @@ xdotool search --name "TIMER" windowactivate && exit 0 # Use xdotool to reactivate original window user focus # After timer is closed or finished, append time into context file alacritty --title TIMER --hold \ - -o "window.dimensions.columns=8" \ - -o "window.dimensions.lines=1" \ - -o "window.position.x=-0" \ - -o "window.position.y=0" \ - -o "window.opacity=0.6" \ - -o "font.size=40" \ - -e "$HOME"/helper/bin/unix/timer.sh \ + -o window.dimensions.columns=8 \ + -o window.dimensions.lines=1 \ + -o window.position.x=-0 \ + -o window.position.y=0 \ + -o window.opacity=0.6 \ + -o font.size=40 \ + -e ~/helper/bin/unix/timer.sh \ SIGINT \ "xdotool windowactivate $origin" \ - '~/helper/bin/task/context_spend_time.sh $count' + "$COMMAND_EXIT" -- cgit v1.2.3-70-g09d2