ed156578810f493571042c88e863b1e57471b91f — psic4t 7 months ago b426018
write README
3 files changed, 28 insertions(+), 45 deletions(-)

M main.go
M qcard
M README.md => README.md +28 -42
@@ 43,7 43,7 @@ Common options:

### Displaying addressbooks 

This simply displays all contacts from all addressbook:
This simply displays all contacts from all addressbooks:


@@ 55,59 55,45 @@ This displays all avaliable addressbooks with their numbers and colors:

    qcaŕd -l

### Add new contact

This creates an appointment on 01.12.2021 from 15:00h to 17:00h with the
summary of "Tea Time":

    qcal -n "20211201 1500 1700 Tea Time"

This creates a whole day appointment with a yearly recurrence in your second
calendar (first is 0):

    qcal -c 1 -n "20211114 Anne's Birthday" -r y

This creates a multiple day appointment:

    qcal -n "20210801 20210810 Holiday in Thailand"
This searches for contacts containing "doe" in all addressbooks:
    qcard -s doe

### Edit an appointment
The DetailThreshold parameter in the configuration file determines when all contact details are shown for a given numer of search results. For instance, on DetailTreshold = 3 you get all details if 3 or less contacts are found for the searchword "doe".

This shows the next 7 days of appointments from calendar 3 with filenames
Here's a list of all attributes:

    qcal -c 2 -7 -f 
   **M:** phoneCell
   **P:** phoneHome
   **p:** phoneWork
   **E:** emailHome
   **e:** emailWork
   **A:** addressHome
   **a:** addressWork
   **O:** Organisation
   **B:** Birthday
   **T:** Title
   **n:** Note

This edits the selected iCAL object in your $EDITOR (i.e. vim). When you
save-quit the modified object is automatically uploaded:

    qcal -c 2 -edit foobarxyz.ics

## Integrations

### neomutt / other cli mail tools
### Add new contact

You can view received appointments in neomutt with qcal! Put this in your
mailcap (usually in .config/neomutt):
This creates a contact for John Doe with a private mobile phone number and an email address in address book 1:

    text/calendar; qcal -p; copiousoutput
    qcard -a 1 -n "John Doe M:+49 172 123123 E:jdoe@data.haus"

If you also want to be able to import received appointments directly from
neomutt, put the following two lines in mailcap:
Just combine the parameters from above like you wish.

    text/calendar; qcal -c 0 -u %s && notify-send "Appointment created";
    text/calendar; qcal -p; copiousoutput
### Edit a contact

The first line is only executed if you press Return. The second line just
displays the appointment as above.
This shows searches for "doe" in addressbook 2 and prints the corresponding filenames

### Crontab (or Statusline script, Systemd timer, etc.) 
    qcal -a 2 -s doe -f

You can get reminders of your appointments 15 mins in advance with this one
This edits the selected vCard object in your $EDITOR (i.e. vim). When you
save-quit the modified object is automatically uploaded:

    [[ $(qcal -cron 15 2>/dev/null) ]] && notify-send "Next Appointment:" "\n $(qcal -cron 15)" || true
    qcal -c 2 -edit foobarxyz.vcf

## About

M main.go => main.go +0 -3
@@ 97,12 97,9 @@ func showAddresses(abNo int) {

func createContact(abNo int, contactData string) {
	//dataArr := strings.Split(appointmentData, " ")
	curTime := time.Now()
	d := regexp.MustCompile(`\s[a-z,A-Z]:`)
	//dataArr := t.SplitAfter(contactData, -1)
	dataArr := splitAfter(contactData, d) // own function, splitAfter is not supported by regex module
	//dataArr := re.FindAll(\s+A-Z:, contactData)

	var fullName string
	var name string

M qcard => qcard +0 -0