summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Makhov <pmakhov@touchtunes.com>2018-11-05 17:03:11 -0500
committerPavel Makhov <pmakhov@touchtunes.com>2018-11-05 17:03:11 -0500
commit90d1836ec99138f8bdc657fefdb29c776318e16f (patch)
treeafcc764c789aa9f7f4214bffe8dfa70f9defaa77
parenta1827a1ab0aff25192fb1ec2bf5d29d524ea1fa8 (diff)
show shell on focused screen and enable history
-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