show shell on focused screen and enable history
This commit is contained in:
parent
a1827a1ab0
commit
90d1836ec9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue