From e76b410b860cefe5f0a3f6c744f317899186e96b Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 21 Jun 2022 09:07:11 +0200 Subject: Changed folder for scripts (see README.md diff) --- scripts/sdep-checknow | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'scripts/sdep-checknow') diff --git a/scripts/sdep-checknow b/scripts/sdep-checknow index 4771957..2cb8f68 100755 --- a/scripts/sdep-checknow +++ b/scripts/sdep-checknow @@ -3,7 +3,7 @@ # Run this every minute (for example using cron) to receive a notification # when an event happens. # -# The events are read from the following files in $sdepdata folder: +# The events are read from the following files in SDEPDATA folder: # once: events that only happen once; full date needs to be specified # daily: events that happen every day; only specify the time in HH:MM format # weekly: only specify Weekday + time @@ -14,8 +14,6 @@ # might have to change if you are not on Linux (on some systems you can # accomplish the same with -j). -sdepdata="${XDG_DATA_HOME:-$HOME/.local/share}/sdep" - #notify="notify-send -t 3600000" notify=herbe title="$(date +%H:%M)" @@ -25,17 +23,17 @@ sdepnotify() { } # One-off events -sdepnotify <"$sdepdata/once" +sdepnotify <"SDEPDATA/once" # Daily events -sed "s/^/$(date +%Y-%m-%d) /" <"$sdepdata/daily" | sdepnotify +sed "s/^/$(date +%Y-%m-%d) /" <"SDEPDATA/daily" | sdepnotify # Weekly events - needs GNU date (try -j intead of -d on BSD) while read line; do weekday=$(echo "$line" | sed "s/ .*$//") echo "$line" | sed "s/^[ ]*[^ ]* /$(date -d $weekday +%Y-%m-%d) /" -done <"$sdepdata/weekly" | \ +done <"SDEPDATA/weekly" | \ sdepnotify # Monthly events -sed "s/^[ ]*/$(date +%Y-%m-)/" <"$sdepdata/daily" | sdepnotify +sed "s/^[ ]*/$(date +%Y-%m-)/" <"SDEPDATA/daily" | sdepnotify -- cgit v1.3