-- Alt+Tab to cycle through windows
awful.keygrabber {
start_callback = function() end,
stop_callback = function() end,
export_keybindings = true,
stop_event = "release",
keybindings = {
{{ "Mod1" }, "Tab", function()
awful.client.focus.byidx(1)
end},
{{ "Mod1", "Shift" }, "Tab", function()
awful.client.focus.byidx(-1)
end},
}
}
-- Hotkeys to switch to workspaces 1-4
for i = 1, 4 do
awful.keyboard.append_global_keybindings({
-- Switch to workspace
awful.key({ modkey }, "#" .. i + 9, function()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end, {description = "view tag #" .. i, group = "tag"}),
-- Move focused window to workspace
awful.key({ modkey, "Shift" }, "#" .. i + 9, function()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end, {description = "move focused client to tag #" .. i, group = "tag"})
})
end
-- Enable dragging windows with the mouse
client.connect_signal("request::default_mousebindings", function()
awful.mouse.append_client_mousebindings({
-- Drag window with Modkey + Left Mouse Button
awful.button({ modkey }, 1, function(c)
c:activate { context = "mouse_click", action = "mouse_move" }
end),
-- Resize window with Modkey + Right Mouse Button
awful.button({ modkey }, 3, function(c)
c:activate { context = "mouse_click", action = "mouse_resize" }
end),
})
end)
is this all right for awesomewm?