summaryrefslogtreecommitdiff
path: root/secrets.lua
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2019-09-01 21:42:13 -0400
committerGitHub <noreply@github.com>2019-09-01 21:42:13 -0400
commit4ed3e8d90a080461a0fb964e3459d3dae76b868e (patch)
treeda4d5a58bedc25ce59d40be4c08e3cc678628794 /secrets.lua
parent1a268b9a90bd2ceb2138d1361efaca2e04e92933 (diff)
parentcd6776c8b0e23ef7cb34a9979012c2a6edb8b295 (diff)
Merge pull request #91 from blix4/both_temp_units
add options to show temperature in both units
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 7d0f773..f387a20 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 = {
-- See volume-widget/README.md
volume_audio_controller = os.getenv('AWW_VOLUME_CONTROLLER') or 'pulse', -- 'pulse' or 'alsa_only'
@@ -15,7 +24,9 @@ local secrets = {
-- OpenWeatherMap API key - https://openweathermap.org/appid
weather_widget_api_key = os.getenv('AWW_WEATHER_API_KEY') or 'API_KEY',
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