diff options
author | Pavel Makhov <pmakhov@touchtunes.com> | 2019-01-25 22:26:16 -0500 |
---|---|---|
committer | Pavel Makhov <pmakhov@touchtunes.com> | 2019-01-25 22:26:16 -0500 |
commit | 15e6d0fcd96acd02250fc6a5bff6590c118cb8a1 (patch) | |
tree | a51b68f53b0dc24c006a6609047e22e654dc20f4 /translate-widget | |
parent | cdd3d9450bd5efc9f1be0392e62131e2d6c38ac2 (diff) |
store api keys and client settings in secrets.lua
Diffstat (limited to 'translate-widget')
-rw-r--r-- | translate-widget/translate.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/translate-widget/translate.lua b/translate-widget/translate.lua index fe242b4..2b64bf8 100644 --- a/translate-widget/translate.lua +++ b/translate-widget/translate.lua @@ -14,8 +14,8 @@ local naughty = require("naughty") local wibox = require("wibox") local gears = require("gears") local gfs = require("gears.filesystem") +local secrets = require("awesome-wm-widgets.secrets") -local API_KEY = '<your api key>' local BASE_URL = 'https://translate.yandex.net/api/v1.5/tr.json/translate' local ICON = '/usr/share/icons/Papirus-Dark/48x48/apps/gnome-translate.svg' @@ -88,7 +88,7 @@ w:setup { --- Main function - takes the user input and shows the widget with translation -- @param request_string - user input (dog enfr) local function translate(to_translate, lang) - local urll = BASE_URL .. '?lang=' .. lang .. '&text=' .. urlencode(to_translate) .. '&key=' .. API_KEY + local urll = BASE_URL .. '?lang=' .. lang .. '&text=' .. urlencode(to_translate) .. '&key=' .. secrets.translate_widget_api_key local resp_json, code = https.request(urll) if (code == 200 and resp_json ~= nil) then |