1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Cleaner config format and added simple_config.yml example

This commit is contained in:
Chris Cummer
2018-04-10 10:12:25 -07:00
committed by Chris Cummer
parent 948d5acb2a
commit 27a267b123
18 changed files with 285 additions and 133 deletions

View File

@@ -30,7 +30,7 @@ import (
func Fetch() (*calendar.Events, error) {
ctx := context.Background()
secretPath, _ := homedir.Expand(Config.UString("wtf.gcal.secretFile"))
secretPath, _ := homedir.Expand(Config.UString("wtf.mods.gcal.secretFile"))
b, err := ioutil.ReadFile(secretPath)
if err != nil {
@@ -49,7 +49,7 @@ func Fetch() (*calendar.Events, error) {
}
t := wtf.Today().Format(time.RFC3339)
events, err := srv.Events.List("primary").ShowDeleted(false).SingleEvents(true).TimeMin(t).MaxResults(int64(Config.UInt("wtf.gcal.eventCount", 10))).OrderBy("startTime").Do()
events, err := srv.Events.List("primary").ShowDeleted(false).SingleEvents(true).TimeMin(t).MaxResults(int64(Config.UInt("wtf.mods.gcal.eventCount", 10))).OrderBy("startTime").Do()
if err != nil {
return nil, err
}

View File

@@ -98,7 +98,7 @@ func (widget *Widget) dayDivider(event, prevEvent *calendar.Event) string {
func (widget *Widget) eventSummary(event *calendar.Event) string {
if widget.eventIsNow(event) {
return fmt.Sprintf("%s %s", Config.UString("wtf.gcal.currentIcon", "🔸"), event.Summary)
return fmt.Sprintf("%s %s", Config.UString("wtf.mods.gcal.currentIcon", "🔸"), event.Summary)
}
return event.Summary