summaryrefslogtreecommitdiff
path: root/secrets.lua
diff options
context:
space:
mode:
authorblix4 <bblix@protonmail.com>2019-08-26 22:28:43 -0700
committerstreetturtle <streetturtle@gmail.com>2019-09-03 21:21:49 -0400
commit7997625cdc334a1e52ca46335399219753500875 (patch)
tree9e8b12d0cd1d102ccbf136c4389e306db71e9579 /secrets.lua
parente1b866e23753e69ce27db64dc6b6b261e6022e24 (diff)
fix after applying blix4's commit
Diffstat (limited to 'secrets.lua')
-rw-r--r--secrets.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/secrets.lua b/secrets.lua
index e110fe5..381f04d 100644
--- a/secrets.lua
+++ b/secrets.lua
@@ -5,6 +5,15 @@
-- @copyright 2019 Pavel Makhov
--------------------------------------------
+local function getenv_bool(var_name, default_val)
+ val = os.getenv(var_name)
+ if val ~= nil then
+ return val:lower() == 'true'
+ else
+ return default_val
+ end
+end
+
local secrets = {
-- Yandex.Translate API key - https://tech.yandex.com/translate/
translate_widget_api_key = os.getenv('AWW_TRANSLATE_API_KEY') or 'API_KEY',
@@ -12,7 +21,9 @@ local secrets = {
-- OpenWeatherMap API key - https://openweathermap.org/appid
weather_widget_api_key = os.getenv('AWW_WEATHER_API_KEY') or 'c3d7320b359da4e48c2d682a04076576',
weather_widget_city = os.getenv('AWW_WEATHER_CITY') or 'Montreal,ca',
- weather_widget_units = os.getenv('AWW_WEATHER_UNITS') or 'metric' -- for celsius, or 'imperial' for fahrenheit
+ weather_widget_units = os.getenv('AWW_WEATHER_UNITS') or 'metric', -- for celsius, or 'imperial' for fahrenheit
+ weather_both_temp_units_widget = getenv_bool('AWW_WEATHER_BOTH_UNITS_WIDGET', false), -- on widget, if true shows "22 C (72 F)", instead of only "22 C"
+ weather_both_temp_units_popup = getenv_bool('AWW_WEATHER_BOTH_UNITS_POPUP', true) -- in the popup, if true shows "22.3 C (72.2 F)" instead of only "22.3 C"
}
return secrets