From 82e4602dc343676eff63e275b4cf5a7082756946 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Thu, 21 Jun 2018 20:35:39 -0700 Subject: [PATCH] Make BarGraph example graph icon configurable Set 'wtf.mods.bargraph.graphIcon` to the string you want to use as the graph icon. --- _sample_configs/bargraph_config.yml | 10 ++-------- _sample_configs/complex_config.yml | 8 ++++---- bargraph/widget.go | 3 ++- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/_sample_configs/bargraph_config.yml b/_sample_configs/bargraph_config.yml index 577771ee..ffdf9fe5 100644 --- a/_sample_configs/bargraph_config.yml +++ b/_sample_configs/bargraph_config.yml @@ -10,18 +10,12 @@ wtf: refreshInterval: 1 mods: bargraph: - colors: - from: - name: coral - displayName: grey - to: - name: white - price: green enabled: true + graphIcon: "🍎" position: top: 2 left: 0 height: 2 width: 2 refreshInterval: 30 - updateInterval: 15 \ No newline at end of file + updateInterval: 15 diff --git a/_sample_configs/complex_config.yml b/_sample_configs/complex_config.yml index 0e95932c..5983683e 100644 --- a/_sample_configs/complex_config.yml +++ b/_sample_configs/complex_config.yml @@ -80,10 +80,6 @@ wtf: secretFile: "~/.config/wtf/gcal/client_secret.json" withLocation: true gspreadsheets: - enabled: true - secretFile: "~/.config/wtf/gspreadsheets/client_secret.json" - refreshInterval: "300" - sheetId: "id_of_google_spreadsheet" colors: values: "green" cells: @@ -93,11 +89,15 @@ wtf: addresses: - "A1" - "A2" + enabled: true position: top: 0 left: 0 width: 1 height: 1 + refreshInterval: "300" + secretFile: "~/.config/wtf/gspreadsheets/client_secret.json" + sheetId: "id_of_google_spreadsheet" git: commitCount: 5 enabled: true diff --git a/bargraph/widget.go b/bargraph/widget.go index 1b2b6ab4..b5b9d9ff 100644 --- a/bargraph/widget.go +++ b/bargraph/widget.go @@ -50,7 +50,8 @@ func MakeGraph(widget *Widget) { } - widget.BarGraph.BuildBars(20, "🌟", stats[:]) + icon := wtf.Config.UString("wtf.mods.bargraph.graphIcon", "✭ ") + widget.BarGraph.BuildBars(20, icon, stats[:]) }