From 90d1836ec99138f8bdc657fefdb29c776318e16f Mon Sep 17 00:00:00 2001 From: Pavel Makhov Date: Mon, 5 Nov 2018 17:03:11 -0500 Subject: show shell on focused screen and enable history --- translate-widget/translate.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'translate-widget') 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 = '' 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 = "Translate: ", 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 -- cgit v1.2.3