aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md95
1 files changed, 94 insertions, 1 deletions
diff --git a/README.md b/README.md
index 5b38847..523ac37 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,95 @@
1# sdep 1# sdep
2A simple "date+event" line parser 2A simple "date+event" line parser.
3
4sdep follows the UNIX philosphy (do one thing well, use stdin and stdout) and
5is heavily inspired by [suckless](https://suckless.org) utilities such as
6[dmenu](https://tools.suckless.org/dmenu/).
7
8You can wrap it around shell scripts to turn it into a no-nonsense calendar
9system.
10
11## Description
12
13sdep reads lines of the form `date text` from stdin and writes to stdout those
14lines such that `date` is between the two dates specified by the `-f` and `-t`
15options, both of which default to the current minute.
16
17The dates should correspond to a unique minute in time. The format for `date`
18can be specified with the same syntax as for date(1).
19
20## Installation
21Edit the Makefile to match your local configuration and type `make install`.
22
23## Examples
24If `events.txt` contains lines formatted as `date text` then
25
26```
27sdep <events.txt
28```
29
30will print all lines whose date match the current minute. Instead
31
32```
33sdep -f <events.txt
34```
35
36will print all the lines whose date is in the past, while
37
38```
39sdep -t -w "%A" <events.txt
40```
41
42will print all lines whose date is in the future, showing only the day of the
43week and the text.
44
45```
46sdep -f "1999-01-01 00:00" -t "1999-12-31 23:59" -w "" <events.txt
47```
48
49will show only the `text` of all lines with a date in 1999. You can specify a
50different format for the dates, for example
51
52```
53sdep +"%m/%d/%Y %I:%M%p" -t "12/31/2020 11:59pm" -w "" <events.txt
54```
55
56will match all dates from December 31st, 2020, one minute before midnight
57(included). Note: this only works if your locale has an am/pm format, see
58date(1).
59
60## A stupidly simple calendar app
61If you keep your events and reminders in a simple plain text file (say
62events.txt), you can run
63
64```
65sdep -w "" -s "" | while read text; do notify-send "$text"; done < events.txt
66```
67
68every minute, for example using cron(8), to get a notification every time
69an events is happens.
70
71You can use `sdep -f -t < events.txt` to list all your events, or
72`sdep -t < events.txt` to list only the future ones. You can specify any date
73range. Running
74
75```
76temp = $(mktemp)
77sdep -t <events.txt >"$temp"
78mv "$temp" events.txt
79```
80
81will remove all old events from your file.
82
83You can edit your events using any text editor and you can keep them synced
84between multiple devices using something like
85[rsync](https://rsync.samba.org/).
86
87## Scripts
88The `scripts` folder contains the few scripts that I use. They are basically
89just a slightly more elaborate version of the calendar system described above,
90with support for recurring events (e.g. weekly, daily). You can install them
91with `make scripts`, but first make sure to adjust them to match your local
92configuration, like the location of the events file.
93
94Most of the script rely on the `-d` option of the GNU date utility, so you
95should change that too if you are on a BSD system or on MacOS.

Generated with cgit - Back to sebastiano.tronto.net