diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2022-06-21 09:07:11 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2022-06-21 09:07:11 +0200 |
| commit | e76b410b860cefe5f0a3f6c744f317899186e96b (patch) | |
| tree | fd310dda1cfe6bc341058cf8e03f442e661aa373 /scripts/sdep-list | |
| parent | b68c98a74cec75946eb29ae814da9fe6ae732cf8 (diff) | |
| download | sdep-e76b410b860cefe5f0a3f6c744f317899186e96b.tar.gz sdep-e76b410b860cefe5f0a3f6c744f317899186e96b.zip | |
Changed folder for scripts (see README.md diff)
Diffstat (limited to '')
| -rwxr-xr-x | scripts/sdep-list | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/scripts/sdep-list b/scripts/sdep-list index 50d3fe7..1a9a1bf 100755 --- a/scripts/sdep-list +++ b/scripts/sdep-list | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | # Recurring events are listed at most once, and only if their first occurrence | 4 | # Recurring events are listed at most once, and only if their first occurrence |
| 5 | # is in the range. | 5 | # is in the range. |
| 6 | # | 6 | # |
| 7 | # The events are read from the following files in the $sdepdata folder: | 7 | # The events are read from the following files in the SDEPDATA folder: |
| 8 | # once: events that only happen once; full date needs to be specified | 8 | # once: events that only happen once; full date needs to be specified |
| 9 | # daily: events that happen every day; only specify the time in HH:MM format | 9 | # daily: events that happen every day; only specify the time in HH:MM format |
| 10 | # weekly: only specify Weekday + time | 10 | # weekly: only specify Weekday + time |
| @@ -15,8 +15,6 @@ | |||
| 15 | # Usage: sdep-list [today|tomorrow|week|nextweek|past|future] | 15 | # Usage: sdep-list [today|tomorrow|week|nextweek|past|future] |
| 16 | # No options = all | 16 | # No options = all |
| 17 | 17 | ||
| 18 | sdepdata="${XDG_DATA_HOME:-$HOME/.local/share}/sdep" | ||
| 19 | |||
| 20 | from="" | 18 | from="" |
| 21 | to="" | 19 | to="" |
| 22 | w="%d %b %H:%M" | 20 | w="%d %b %H:%M" |
| @@ -54,13 +52,13 @@ esac | |||
| 54 | 52 | ||
| 55 | tempfile=$(mktemp) | 53 | tempfile=$(mktemp) |
| 56 | 54 | ||
| 57 | cat "$sdepdata/once" > "$tempfile" | 55 | cat "SDEPDATA/once" > "$tempfile" |
| 58 | sed "s/^/$(date +%Y-%m-%d) /" <"$sdepdata/daily" >> "$tempfile" | 56 | sed "s/^/$(date +%Y-%m-%d) /" <"SDEPDATA/daily" >> "$tempfile" |
| 59 | while read line; do | 57 | while read line; do |
| 60 | weekday=$(echo "$line" | sed "s/ .*$//") | 58 | weekday=$(echo "$line" | sed "s/ .*$//") |
| 61 | echo "$line" | sed "s/^[ ]*[^ ]* /$(date -d $weekday +%Y-%m-%d) /" | 59 | echo "$line" | sed "s/^[ ]*[^ ]* /$(date -d $weekday +%Y-%m-%d) /" |
| 62 | done <"$sdepdata/weekly" >> "$tempfile" | 60 | done <"SDEPDATA/weekly" >> "$tempfile" |
| 63 | sed "s/^[ ]*/$(date +%Y-%m-)/" <"$sdepdata/daily" >> "$tempfile" | 61 | sed "s/^[ ]*/$(date +%Y-%m-)/" <"SDEPDATA/daily" >> "$tempfile" |
| 64 | 62 | ||
| 65 | sdep -w "$w" -f "$from" -t "$to" <"$tempfile" | 63 | sdep -w "$w" -f "$from" -t "$to" <"$tempfile" |
| 66 | 64 | ||
