summaryrefslogtreecommitdiff
path: root/translate-widget
diff options
context:
space:
mode:
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