summaryrefslogtreecommitdiff
path: root/translate-widget
diff options
context:
space:
mode:
authorSam Delmerico <svdelmerico@gmail.com>2018-11-26 16:21:48 -0500
committerSam Delmerico <svdelmerico@gmail.com>2018-11-26 16:21:48 -0500
commit2cf217dc6c45f206aef0e065fa3ede4c36d73e3b (patch)
treea257f029216862d7525ca7e6e1818982b4a03085 /translate-widget
parentf369e1cb28a308f6967d7bc31375c637755b1e3f (diff)
parent1eefac87faefa22b0d3941a9fd4c76010688f59e (diff)
merge biased battery levels
Diffstat (limited to 'translate-widget')
-rw-r--r--translate-widget/translate.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/translate-widget/translate.lua b/translate-widget/translate.lua
index e046604..fe242b4 100644
--- a/translate-widget/translate.lua
+++ b/translate-widget/translate.lua
@@ -13,6 +13,7 @@ local json = require("json")
local naughty = require("naughty")
local wibox = require("wibox")
local gears = require("gears")
+local gfs = require("gears.filesystem")
local API_KEY = '<your api key>'
local BASE_URL = 'https://translate.yandex.net/api/v1.5/tr.json/translate'
@@ -45,7 +46,6 @@ local w = wibox {
border_width = 1,
border_color = '#66ccff',
ontop = true,
- screen = mouse.screen,
expand = true,
bg = '#1e252c',
max_widget_size = 500,
@@ -163,13 +163,14 @@ input_widget:setup {
}
local function show_translate_prompt()
- awful.placement.top(input_widget, { margins = {top = 40}})
+ awful.placement.top(input_widget, { margins = {top = 40}, parent = awful.screen.focused()})
input_widget.height = 40
input_widget.visible = true
awful.prompt.run {
prompt = "<b>Translate</b>: ",
textbox = prompt.widget,
+ history_path = gfs.get_dir('cache') .. '/translate_history',
bg_cursor = '#66ccff',
exe_callback = function(text)
if not text or #text == 0 then return end