From ff3dfc91aebd454323a25baf6ffd8c9145747564 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 6 Apr 2023 17:25:36 +0800 Subject: WIP --- X11/openbox/rc.xml | 16 +--------------- X11/show_timer.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-) create mode 100755 X11/show_timer.sh (limited to 'X11') diff --git a/X11/openbox/rc.xml b/X11/openbox/rc.xml index f08a79c..7b923cd 100644 --- a/X11/openbox/rc.xml +++ b/X11/openbox/rc.xml @@ -514,21 +514,7 @@ - - sh -c ' - origin=`xdotool getactivewindow`; \ - xdotool search --name "TIMER" windowactivate || \ - 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 ~/helper/bin/unix/timer.sh SIGINT \ - "xdotool windowactivate $origin" - ' - + ~/helper/X11/show_timer.sh diff --git a/X11/show_timer.sh b/X11/show_timer.sh new file mode 100755 index 0000000..6ff405a --- /dev/null +++ b/X11/show_timer.sh @@ -0,0 +1,17 @@ +#! /bin/sh + +export origin=`xdotool getactivewindow`; \ + +# If timer is set, focus to it +xdotool search --name "TIMER" windowactivate && exit 0 + +# Add new window for a timer +# Use SIGINT +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 sh -c '~/helper/bin/unix/timer.sh SIGINT "xdotool windowactivate $origin"' -- cgit v1.2.3-70-g09d2