diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-12-23 11:37:28 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-12-23 11:37:28 +0100 |
| commit | ce2e0431208df6581ffbe80cb397e4f6dd8b2cec (patch) | |
| tree | 955b6be59884229125a63f070e16992dc5a79ca1 /event | |
| parent | 49f83b383d9048ce3d620a91a4005245aa1599dc (diff) | |
| download | scripts-ce2e0431208df6581ffbe80cb397e4f6dd8b2cec.tar.gz scripts-ce2e0431208df6581ffbe80cb397e4f6dd8b2cec.zip | |
Revert "Added notify-loop"
This reverts commit 49f83b383d9048ce3d620a91a4005245aa1599dc.
Diffstat (limited to '')
| -rwxr-xr-x | event | 19 |
1 files changed, 0 insertions, 19 deletions
| @@ -7,7 +7,6 @@ | |||
| 7 | 7 | ||
| 8 | file="$HOME/box/events" # Change to $XDG_DATA_HOME/events or whatever | 8 | file="$HOME/box/events" # Change to $XDG_DATA_HOME/events or whatever |
| 9 | editor=${EDITOR:-vi} | 9 | editor=${EDITOR:-vi} |
| 10 | notify=${NOTIFY:-"notify push"} | ||
| 11 | 10 | ||
| 12 | usage() { | 11 | usage() { |
| 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 | ||
| 27 | secondstoday() { | 24 | secondstoday() { |
| @@ -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 | ;; |
