diff --git a/awesomerc.lua.in b/awesomerc.lua.in index c5151d38..ce120651 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -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 () diff --git a/awful.lua b/awful.lua index 1b48c89d..3d9cba31 100644 --- a/awful.lua +++ b/awful.lua @@ -461,9 +461,12 @@ local function menu_text_with_cursor(text, text_color, cursor_color, cursor_pos) return text_start .. "" .. char .. "" .. 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