cleaned up readme

This commit is contained in:
trav 2020-11-18 20:15:42 -05:00
parent 12a111d877
commit 4ca1290a4f

View File

@ -1,13 +1,15 @@
# calendarender
### and also calendarchive
#### and also calendarchive
These are 2 scripts for calendaring in plantext files. calendar.txt shows the current day at the top and continues down as far as the number of months you have rendered.
These are 2 scripts for calendaring in plantext files.
calendar_archive.txt contains all the days before current day.
`calendar.txt`shows the current day at the top and continues down as far as the number of months you have rendered.
`calendar_archive.txt` contains all the days before current day.
It looks like this:
```
☼ sun nov 29
water plants
coop fed potluck
@ -29,19 +31,19 @@ reading group
⇃◌ thu dec 03
open hours at lab
```
## installation
1. clone or download the repo.
2. configure calendarender by opening the file in your texteditor of choice and modify the line:
2. configure calendarender by opening calendarender.sh in your texteditor of choice and modify the line:
`calendarFile="/Users/YOU/WHEREYOURNOTESARE/calendar.txt"`
to say where your calendar file is. This must be the absolute path to your calendar file. If you don't have one just make an empty txt file there to start.
You might also like to configure recurring events. There is SERIOUS ROOM FOR IMPROVEMENT in this. It really ought to be in a separate config file. BUT ALAS, as it is, recurring events are hardcoded. So, if you have things that happen weekly or monthly and you want them to be auto-rendered, you'll need to modify this code block:
You might also like to configure recurring events. I have some SERIOUS ROOM FOR IMPROVEMENT here, it's true. Recurring events really ought to be in a separate config file. BUT ALAS, it works for me as recurring events rarely change, it is what it is, recurring events are hardcoded. So, if you have things that happen weekly or monthly and you want them to be auto-rendered, you'll need to modify this code block:
```
#every sunday
@ -52,33 +54,47 @@ You might also like to configure recurring events. There is SERIOUS ROOM FOR IMP
if [ "$dayOfWeek" = "Sun" ] && [ "$sunday" -eq 3 ]; then echo "example potluck on third sunday">> $calendarFile; fi
#last sunday
if [ "$(date -v1d -v+"$tooFarNum"m -v-1d -v-sun +%a-%b-%d)" = "$(date -v1d -v+"$1"m -v+"$PLACEINMONTH"d +%a-%b-%d)" ] && [ "$dayOfWeek" = "Sun" ]; then echo "last sunday of th>
#every monday
...
```
Anytime something is echoed it goes in the file. Make sure not to get rid of the section `sunday=$(($sunday+1))` because that is how the program keeps track of which sunday (etc) we're on.
Anytime something is `echo`ed it gets added to your calendar. Make sure not to get rid of the section `sunday=$(($sunday+1))` because that is how the program keeps track of which sunday (etc) we're on.
3. configure calendarchive
Within calendarchive.sh, find the lines:
`calendarFile="/Users/YOU/YOURNOTESFOLDER/calendar.txt"`
`calendarchive="/Users/YOU/YOURNOTESFOLDER/calendar_archive.txt"`
make sure both those exist at least as blank files.
you might need to `chmod +x` each of the scripts to make sure they're executable.
and modify them to point to your calendar files. Make sure both those exist at least as blank files.
4. You can now just run them with `sh calendarchive.sh` or `sh calendarender.sh' but they're easier to use if they're in your path. Copy the scripts somewhere like `~/bin` and add `export PATH=$PATH:~/bin` to `~/.bashrc`
4. you might need to `chmod +x` each of the scripts to make sure they're executable.
5. You can now just run them with `sh calendarchive.sh` or `sh calendarender.sh` but they're easier to use if they're in your path:
Copy the scripts somewhere like `~/bin` and add `export PATH=$PATH:~/bin` to `~/.bashrc`
## usage
My personal notes folder is plaintext synced between machines with SyncThing and accessed via NotationalVelocity (or sometimes TextEdit, nano, whatever). I keep calendar.txt, calendar_archive.txt and all sorts of other notes in there.
### calendarender
calendarender takes one argument and that's the number of months in the future you'd like to render. So say it's currently a day in November and I want to add the days in January to my calendar.txt.
I would run `calendarender 2`. It'll print to the terminal as well as to the file.
calendarender takes one argument and that's the number of months in the future you'd like to render. So say it's currently a day in November and I want to add the days in January to my calendar.txt, I would run `calendarender 2`. It'll print to the terminal as well as to the file.
calendarender also prints relevant moon phases: new, full, crescents and halfs. If it's waxing an up-arrow will be printed, waning, down-arrow. It's not the _most_ accurate moon-phase algorithm but close enough for me :)
### calendarchive
if you run calendarchive as it is it will remove all days from calendar.txt that are before the current day and append them to the bottom of calendar_archive.txt. If it's late at night but before midnight you can run `calendarchive 1` and it'll also archive today.
if you run calendarchive without any arguments it will remove all days from calendar.txt that are before the current day and append them to the bottom of calendar_archive.txt. If it's late at night but before midnight you can run `calendarchive 1` and it'll also archive today as well.
you could cron calendarchive to have it automatically run but personally I keep all kinds of notes and things in my calendar and don't want to lose track of anything. So I manually run calendarchive.