aboutsummaryrefslogtreecommitdiff
path: root/scripts-build/sdep-checknow
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2022-02-09 19:13:45 +0100
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2022-02-09 19:13:45 +0100
commit0bcca7b6808a02af3c4758c30eec9984d44dfac7 (patch)
tree34d1e08904229c797e9aa07e656bbe2eb30d7f40 /scripts-build/sdep-checknow
parentc88e94d631b09d6f0839b4f96df2be974b23217e (diff)
downloadsdep-0bcca7b6808a02af3c4758c30eec9984d44dfac7.tar.gz
sdep-0bcca7b6808a02af3c4758c30eec9984d44dfac7.zip
Changed notification system to herbe.
Diffstat (limited to '')
-rw-r--r--scripts-build/sdep-checknow37
1 files changed, 0 insertions, 37 deletions
diff --git a/scripts-build/sdep-checknow b/scripts-build/sdep-checknow
deleted file mode 100644
index acd619d..0000000
--- a/scripts-build/sdep-checknow
+++ /dev/null
@@ -1,37 +0,0 @@
1#!/bin/sh
2
3# Run this every minute (for example using cron) to receive a notification
4# when an event happens.
5#
6# The events are read from the following files in /home/sebastiano/.local/share/sdep folder:
7# once: events that only happen once; full date needs to be specified
8# daily: events that happen every day; only specify the time in HH:MM format
9# weekly: only specify Weekday + time
10# monthly: only specify day of the month + time
11
12# Requires: notify-send; the weekly part uses the non-portable -d option of
13# GNU date, which you might have to change if you are not on Linux (on some
14# systems you can accomplish the same with -j).
15
16notify="notify-send -t 3600000"
17title="$(date +%H:%M)"
18
19sdepnotify() {
20 sdep -w "" -s "" | while read text; do $notify "$title" "$text"; done
21}
22
23# One-off events
24sdepnotify <"/home/sebastiano/.local/share/sdep/once"
25
26# Daily events
27sed "s/^/$(date +%Y-%m-%d) /" <"/home/sebastiano/.local/share/sdep/daily" | sdepnotify
28
29# Weekly events - needs GNU date (try -j intead of -d on BSD)
30while read line; do
31 weekday=$(echo "$line" | sed "s/ .*$//")
32 echo "$line" | sed "s/^[ ]*[^ ]* /$(date -d $weekday +%Y-%m-%d) /"
33done <"/home/sebastiano/.local/share/sdep/weekly" | \
34sdepnotify
35
36# Monthly events
37sed "s/^[ ]*/$(date +%Y-%m-)/" <"/home/sebastiano/.local/share/sdep/daily" | sdepnotify

Generated with cgit - Back to sebastiano.tronto.net