2012-07-06 14:19:54 +02:00
|
|
|
config.keys = {}
|
|
|
|
config.mouse = {}
|
2012-07-14 16:37:32 +02:00
|
|
|
local volume = loadrc("volume", "vbe/volume")
|
2012-07-06 14:19:54 +02:00
|
|
|
|
2012-07-14 01:58:18 +02:00
|
|
|
local function client_info()
|
|
|
|
local v = ""
|
|
|
|
|
|
|
|
-- object
|
|
|
|
local c = client.focus
|
|
|
|
v = v .. tostring(c)
|
|
|
|
|
|
|
|
-- geometry
|
|
|
|
local cc = c:geometry()
|
|
|
|
local signx = (cc.x > 0 and "+") or ""
|
|
|
|
local signy = (cc.y > 0 and "+") or ""
|
|
|
|
v = v .. " @ " .. cc.width .. 'x' .. cc.height .. signx .. cc.x .. signy .. cc.y .. "\n\n"
|
|
|
|
|
|
|
|
local inf = {
|
|
|
|
"name", "icon_name", "type", "class", "role", "instance", "pid",
|
|
|
|
"icon_name", "skip_taskbar", "id", "group_id", "leader_id", "machine",
|
|
|
|
"screen", "hide", "minimize", "size_hints_honor", "titlebar", "urgent",
|
|
|
|
"focus", "opacity", "ontop", "above", "below", "fullscreen", "transient_for"
|
|
|
|
}
|
|
|
|
|
|
|
|
for i = 1, #inf do
|
|
|
|
v = v .. string.format('%2s: <span color="%s">%-16s</span> = <span color="%s">%s</span>\n',
|
|
|
|
i,
|
|
|
|
beautiful.fg_widget_label, inf[i],
|
|
|
|
beautiful.fg_widget_value, tostring(c[inf[i]]))
|
|
|
|
end
|
|
|
|
|
|
|
|
naughty.notify{ text = string.format('<span font="Terminus 8">%s</span>', v:sub(1,#v-1)),
|
|
|
|
timeout = 0, margin = 10, screen = c.screen }
|
|
|
|
end
|
|
|
|
|
2012-07-06 14:19:54 +02:00
|
|
|
config.keys.global = awful.util.table.join(
|
|
|
|
-- Tag navigation
|
|
|
|
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
|
|
|
|
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
|
|
|
|
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
|
|
|
|
|
|
|
|
-- Focus
|
|
|
|
awful.key({ modkey, }, "j",
|
|
|
|
function ()
|
|
|
|
awful.client.focus.byidx( 1)
|
|
|
|
if client.focus then client.focus:raise() end
|
|
|
|
end),
|
|
|
|
awful.key({ modkey, }, "k",
|
|
|
|
function ()
|
|
|
|
awful.client.focus.byidx(-1)
|
|
|
|
if client.focus then client.focus:raise() end
|
|
|
|
end),
|
2012-07-11 22:45:58 +02:00
|
|
|
awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
|
2012-07-06 14:19:54 +02:00
|
|
|
|
|
|
|
-- Layout manipulation
|
|
|
|
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
|
|
|
|
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
|
|
|
|
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
|
|
|
|
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
|
|
|
|
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
|
|
|
|
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
|
|
|
|
awful.key({ modkey, }, "space", function () awful.layout.inc(config.layouts, 1) end),
|
|
|
|
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(config.layouts, -1) end),
|
|
|
|
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
|
|
|
|
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
|
|
|
|
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
|
|
|
|
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
|
|
|
|
awful.key({ modkey, }, "Tab",
|
|
|
|
function ()
|
|
|
|
awful.client.focus.history.previous()
|
|
|
|
if client.focus then
|
|
|
|
client.focus:raise()
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
|
|
|
|
-- Spawn a terminal
|
|
|
|
awful.key({ modkey, }, "Return", function () awful.util.spawn(config.terminal) end),
|
|
|
|
|
|
|
|
-- Restart awesome
|
2012-07-07 12:16:21 +02:00
|
|
|
awful.key({ modkey, "Control" }, "r", awesome.restart),
|
|
|
|
|
|
|
|
-- Multimedia keys
|
2012-07-14 16:29:19 +02:00
|
|
|
awful.key({ }, "XF86AudioRaiseVolume", volume.increase),
|
|
|
|
awful.key({ }, "XF86AudioLowerVolume", volume.decrease),
|
|
|
|
awful.key({ }, "XF86AudioMute", volume.toggle)
|
2012-07-06 14:19:54 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
config.keys.client = awful.util.table.join(
|
|
|
|
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
|
|
|
|
awful.key({ modkey, }, "x", function (c) c:kill() end),
|
|
|
|
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
|
|
|
|
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
|
|
|
|
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
|
|
|
|
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
|
2012-07-14 01:58:18 +02:00
|
|
|
awful.key({ modkey, }, "i", client_info),
|
2012-07-06 14:19:54 +02:00
|
|
|
awful.key({ modkey, }, "m",
|
|
|
|
function (c)
|
|
|
|
c.maximized_horizontal = not c.maximized_horizontal
|
|
|
|
c.maximized_vertical = not c.maximized_vertical
|
|
|
|
end)
|
|
|
|
)
|
|
|
|
|
|
|
|
config.mouse.client = awful.util.table.join(
|
|
|
|
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
|
|
|
|
awful.button({ modkey }, 1, awful.mouse.client.move),
|
|
|
|
awful.button({ modkey }, 3, awful.mouse.client.resize))
|