aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-12-23 11:37:28 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2024-12-23 11:37:28 +0100
commitce2e0431208df6581ffbe80cb397e4f6dd8b2cec (patch)
tree955b6be59884229125a63f070e16992dc5a79ca1
parent49f83b383d9048ce3d620a91a4005245aa1599dc (diff)
downloadscripts-ce2e0431208df6581ffbe80cb397e4f6dd8b2cec.tar.gz
scripts-ce2e0431208df6581ffbe80cb397e4f6dd8b2cec.zip
Revert "Added notify-loop"
This reverts commit 49f83b383d9048ce3d620a91a4005245aa1599dc.
-rwxr-xr-xevent19
1 files changed, 0 insertions, 19 deletions
diff --git a/event b/event
index 94dfbfb..16991cf 100755
--- a/event
+++ b/event
@@ -7,7 +7,6 @@
7 7
8file="$HOME/box/events" # Change to $XDG_DATA_HOME/events or whatever 8file="$HOME/box/events" # Change to $XDG_DATA_HOME/events or whatever
9editor=${EDITOR:-vi} 9editor=${EDITOR:-vi}
10notify=${NOTIFY:-"notify push"}
11 10
12usage() { 11usage() {
13 echo "Usage: event [command]" 12 echo "Usage: event [command]"
@@ -20,8 +19,6 @@ usage() {
20 echo " date: now, n; today, t; tomorrow, tm;" 19 echo " date: now, n; today, t; tomorrow, tm;"
21 echo " week, w; nextweek, nw;" 20 echo " week, w; nextweek, nw;"
22 echo " future, f; past, p" 21 echo " future, f; past, p"
23 echo " notify-loop Notify of all past events, then start a loop that"
24 echo " checks for events every minute and notifies"
25} 22}
26 23
27secondstoday() { 24secondstoday() {
@@ -151,22 +148,6 @@ case "$1" in
151 list) 148 list)
152 cat "$file" | list $2 | sort 149 cat "$file" | list $2 | sort
153 ;; 150 ;;
154 notify-loop)
155 clean="sed -E 's/....-..-.. .{1,2}:..[[:space:]]*//g'"
156 cat "$file" | list past | sort | \
157 sed -E 's/....-..-.. .{1,2}:..[[:space:]]*//g' | \
158 while read text; do
159 $notify "$text"
160 done &
161 while true; do
162 cat "$file" | list now | sort | \
163 sed -E 's/....-..-.. .{1,2}:..[[:space:]]*//g' | \
164 while read text; do
165 $notify "$text"
166 done &
167 sleep $((60 - $(date +%-S)))
168 done
169 ;;
170 *) 151 *)
171 usage 152 usage
172 ;; 153 ;;

Generated with cgit - Back to sebastiano.tronto.net