awful: simplify menu args
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
66258a6d23
commit
975eba0049
|
@ -206,8 +206,12 @@ keybinding.new({ modkey }, "space", function () awful.layout.inc(layouts, 1) end
|
|||
keybinding.new({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end):add()
|
||||
|
||||
-- Menu
|
||||
keybinding.new({ modkey }, "F1", function () awful.menu("Run: ", mymenubox, fg_focus, bg_focus, awful.spawn) end):add()
|
||||
keybinding.new({ modkey }, "F4", function () awful.menu("Run Lua code: ", mymenubox, fg_focus, bg_focus, awful.eval) end):add()
|
||||
keybinding.new({ modkey }, "F1", function ()
|
||||
awful.menu({ prompt = "Run: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mymenubox, awful.spawn)
|
||||
end):add()
|
||||
keybinding.new({ modkey }, "F4", function ()
|
||||
awful.menu({ prompt = "Run Lua code: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mymenubox, awful.eval)
|
||||
end):add()
|
||||
|
||||
--- Tabulous, tab manipulation
|
||||
keybinding.new({ modkey, "Control" }, "y", function ()
|
||||
|
|
|
@ -461,9 +461,12 @@ local function menu_text_with_cursor(text, text_color, cursor_color, cursor_pos)
|
|||
return text_start .. "<span background=\"" .. cursor_color .. "\" foreground=\"" .. text_color .. "\">" .. char .. "</span>" .. text_end
|
||||
end
|
||||
|
||||
local function menu(p, textbox, inv_col, cur_col, exe_callback)
|
||||
local function menu(args, textbox, exe_callback)
|
||||
if not args then return end
|
||||
local command = ""
|
||||
local prompt = p or ""
|
||||
local prompt = args.prompt or ""
|
||||
local inv_col = args.cursor_fg or "black"
|
||||
local cur_col = args.cursor_bg or "white"
|
||||
local cur_pos = 1
|
||||
if not textbox or not exe_callback then
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue