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

Generated with cgit - Back to sebastiano.tronto.net