From d9eb3885eea90e06b79ff8fc4b2d1c1b8f5e4cfd Mon Sep 17 00:00:00 2001 From: streetturtle Date: Wed, 2 Dec 2020 09:24:05 -0500 Subject: trigger build action on a branch --- translate-widget/translate.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'translate-widget') diff --git a/translate-widget/translate.lua b/translate-widget/translate.lua index 811e136..1499333 100644 --- a/translate-widget/translate.lua +++ b/translate-widget/translate.lua @@ -16,7 +16,8 @@ local wibox = require("wibox") local gears = require("gears") local gfs = require("gears.filesystem") -local TRANSLATE_CMD = [[bash -c 'curl -s -u "apikey:%s" -H "Content-Type: application/json" -d '\''{"text": ["%s"], "model_id":"%s"}'\'' "%s/v3/translate?version=2018-05-01"']] +local TRANSLATE_CMD = [[bash -c 'curl -s -u "apikey:%s" -H "Content-Type: application/json"]] + ..[[ -d '\''{"text": ["%s"], "model_id":"%s"}'\'' "%s/v3/translate?version=2018-05-01"']] local ICON = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/translate-widget/gnome-translate.svg' --- Returns two values - string to translate and direction: @@ -82,12 +83,14 @@ local function translate(to_translate, lang, api_key, url) { { id = 'src', - markup = '' .. lang:sub(1,2) .. ': ' .. to_translate .. '', + markup = '' .. lang:sub(1,2) .. ': ' + .. to_translate .. '', widget = wibox.widget.textbox }, { id = 'res', - markup = '' .. lang:sub(4) .. ': ' .. resp.translations[1].translation .. '', + markup = '' .. lang:sub(4) .. ': ' + .. resp.translations[1].translation .. '', widget = wibox.widget.textbox }, id = 'text', @@ -110,11 +113,11 @@ local function translate(to_translate, lang, api_key, url) w:buttons( awful.util.table.join( awful.button({}, 1, function() - awful.spawn.with_shell("echo '" .. resp.translations[1].translation .. "' | xclip -selection clipboard") + spawn.with_shell("echo '" .. resp.translations[1].translation .. "' | xclip -selection clipboard") w.visible = false end), awful.button({}, 3, function() - awful.spawn.with_shell("echo '" .. to_translate .."' | xclip -selection clipboard") + spawn.with_shell("echo '" .. to_translate .."' | xclip -selection clipboard") w.visible = false end) ) -- cgit v1.2.3