awesomerc: split promptbox by screen (FS#332)
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
bc5569ab94
commit
68ac8e1c65
|
@ -118,7 +118,6 @@ mytasklist.label = awful.widget.tasklist.label.currenttags
|
|||
mytextbox = widget({ type = "textbox", name = "mytextbox", align = "right" })
|
||||
-- Set the default text in textbox
|
||||
mytextbox.text = "<b><small> " .. AWESOME_RELEASE .. " </small></b>"
|
||||
mypromptbox = widget({ type = "textbox", name = "mypromptbox", align = "left" })
|
||||
|
||||
-- Create a laucher widget
|
||||
mylauncher = awful.widget.launcher({ name = "mylauncher",
|
||||
|
@ -144,15 +143,17 @@ end
|
|||
|
||||
-- Create a wibox for each screen and add it
|
||||
mywibox = {}
|
||||
mypromptbox = {}
|
||||
for s = 1, screen.count() do
|
||||
mywibox[s] = wibox({ position = "top", name = "mywibox" .. s,
|
||||
fg = beautiful.fg_normal, bg = beautiful.bg_normal })
|
||||
mypromptbox[s] = widget({ type = "textbox", name = "mypromptbox" .. s, align = "left" })
|
||||
-- Add widgets to the wibox - order matters
|
||||
mywibox[s]:widgets({
|
||||
mytaglist,
|
||||
mytasklist,
|
||||
mylauncher,
|
||||
mypromptbox,
|
||||
mypromptbox[s],
|
||||
mytextbox,
|
||||
mylayoutbox[s],
|
||||
s == 1 and mysystray or nil
|
||||
|
@ -219,7 +220,7 @@ keybinding({ modkey }, "Escape", awful.tag.history.restore):add()
|
|||
keybinding({ modkey }, "Return", function () awful.util.spawn(terminal) end):add()
|
||||
|
||||
keybinding({ modkey, "Control" }, "r", function ()
|
||||
mypromptbox.text =
|
||||
mypromptbox[mouse.screen].text =
|
||||
awful.util.escape(awful.util.restart())
|
||||
end):add()
|
||||
keybinding({ modkey, "Shift" }, "q", awesome.quit):add()
|
||||
|
@ -253,24 +254,25 @@ keybinding({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -
|
|||
|
||||
-- Prompt
|
||||
keybinding({ modkey }, "F1", function ()
|
||||
awful.prompt.run({ prompt = "Run: " }, mypromptbox, awful.util.spawn, awful.completion.bash,
|
||||
awful.prompt.run({ prompt = "Run: " }, mypromptbox[mouse.screen], awful.util.spawn, awful.completion.bash,
|
||||
os.getenv("HOME") .. "/.cache/awesome/history") end):add()
|
||||
keybinding({ modkey }, "F4", function ()
|
||||
awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox, awful.util.eval, awful.prompt.bash,
|
||||
awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen], awful.util.eval, awful.prompt.bash,
|
||||
os.getenv("HOME") .. "/.cache/awesome/history_eval") end):add()
|
||||
keybinding({ modkey, "Ctrl" }, "i", function ()
|
||||
if mypromptbox.text then
|
||||
mypromptbox.text = nil
|
||||
local s = mouse.screen
|
||||
if mypromptbox[s].text then
|
||||
mypromptbox[s].text = nil
|
||||
else
|
||||
mypromptbox.text = nil
|
||||
mypromptbox[s].text = nil
|
||||
if client.focus.class then
|
||||
mypromptbox.text = "Class: " .. client.focus.class .. " "
|
||||
mypromptbox[s].text = "Class: " .. client.focus.class .. " "
|
||||
end
|
||||
if client.focus.instance then
|
||||
mypromptbox.text = mypromptbox.text .. "Instance: ".. client.focus.instance .. " "
|
||||
mypromptbox[s].text = mypromptbox[s].text .. "Instance: ".. client.focus.instance .. " "
|
||||
end
|
||||
if client.focus.role then
|
||||
mypromptbox.text = mypromptbox.text .. "Role: ".. client.focus.role
|
||||
mypromptbox[s].text = mypromptbox[s].text .. "Role: ".. client.focus.role
|
||||
end
|
||||
end
|
||||
end):add()
|
||||
|
|
Loading…
Reference in New Issue