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