~psic4t/qcal

9ac521d9ada326a9e87111087e4904d7fc1ae8c5 — psic4t 9 months ago c1f0f86
Truncate URLs in calendar listing
4 files changed, 10 insertions(+), 6 deletions(-)

M README.md
M TODO
M defines.go
M helpers.go
M README.md => README.md +2 -2
@@ 116,12 116,12 @@ neomutt, put the following two lines in mailcap:
The first line is only executed if you press Return. The second line just
displays the appointment as above.

### Crontab 
### Crontab (or Statusline script, Systemd timer, etc.) 

You can get reminders of your appointments 15 mins in advance with this one
liner:

    EVENT=$(qcal -cron 15); [[ $EVENT ]] && notify-send "Next Appointment:" "\n$EVENT"
    [[ $(qcal -cron 15 2>/dev/null) ]] && notify-send "Next Appointment:" "\n $(qcal -cron 15)" || true


## About

M TODO => TODO +0 -2
@@ 1,6 1,4 @@
# TODO

* support UNTIL in appointments
* import mode (for mutt)
* display ics for past appointments
* implement public calendars (webcal/ical)

M defines.go => defines.go +1 -1
@@ 27,7 27,7 @@ var colorBlock string = "█"
var elements []Event
var Colors = [10]string{"\033[0;31m", "\033[0;32m", "\033[1;33m", "\033[1;34m", "\033[1;35m", "\033[1;36m", "\033[1;37m", "\033[1;38m", "\033[1;39m", "\033[1;40m"}
var showColor bool = true
var qcalversion string = "0.8.3"
var qcalversion string = "0.8.4"

const (
	ConfigDir      = ".config/qcal"

M helpers.go => helpers.go +7 -1
@@ 9,6 9,7 @@ import (
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
	"os"
	"path"
	"sort"


@@ 51,8 52,13 @@ func getProp() {
	})

	for i := range p {
		u, err := url.Parse(config.Calendars[i].Url)
		if err != nil {
			log.Fatal(err)
		}

		fmt.Println(`[` + fmt.Sprintf("%v", i) + `] - ` + Colors[i] + colorBlock + ColDefault +
			` ` + p[i].displayName + ` (` + config.Calendars[i].Url + `)`)
			` ` + p[i].displayName + ` (` + u.Hostname() + `)`)
	}
}