for i = 1, keynumber do
keybinding({ modkey }, i,
function ()
- local screen = mouse.screen_get()
+ local screen = mouse.screen
if tags[screen][i] then
awful.tag.viewonly(tags[screen][i])
end
end):add()
keybinding({ modkey, "Control" }, i,
function ()
- local screen = mouse.screen_get()
+ local screen = mouse.screen
if tags[screen][i] then
tags[screen][i].selected = not tags[screen][i].selected
end
end):add()
keybinding({ modkey, "Shift" }, i,
function ()
- local screen = mouse.screen_get()
+ local screen = mouse.screen
if tags[screen][i] then
awful.client.movetotag(tags[screen][i])
end
end):add()
keybinding({ modkey, "Control", "Shift" }, i,
function ()
- local screen = mouse.screen_get()
+ local screen = mouse.screen
if tags[screen][i] then
awful.client.toggletag(tags[screen][i])
end
for i = 1, keynumber do
keybinding({ modkey, "Shift" }, "F" .. i,
function ()
- local screen = mouse.screen_get()
+ local screen = mouse.screen
if tags[screen][i] then
for k, c in pairs(awful.client.getmarked()) do
awful.client.movetotag(tags[screen][i], c)
-- Hook function to execute when focusing a client.
function hook_focus(c)
if not awful.client.ismarked(c) then
- c:border_set({ width = border_width, color = border_focus })
+ c.border_color = border_focus
end
end
-- Hook function to execute when unfocusing a client.
function hook_unfocus(c)
if not awful.client.ismarked(c) then
- c:border_set({ width = border_width, color = border_normal })
+ c.border_color = border_normal
end
end
-- Hook function to execute when marking a client
function hook_marked(c)
- c:border_set({ width = border_width, color = border_marked })
+ c.border_color = border_marked
end
-- Hook function to execute when unmarking a client
function hook_unmarked(c)
- c:border_set({ width = border_width, color = border_focus })
+ c.border_color = border_focus
end
-- Hook function to execute when the mouse is over a client.
function hook_mouseover(c)
-- Sloppy focus, but disabled for magnifier layout
- if awful.layout.get(c:screen_get()) ~= "magnifier" then
+ if awful.layout.get(c.screen) ~= "magnifier" then
c:focus_set()
end
end
c:mouse_add(mouse({ modkey }, 3, function (c) c:mouse_resize() end))
-- New client may not receive focus
-- if they're not focusable, so set border anyway.
- c:border_set({ width = border_width, color = border_normal })
+ c.border_width = border_width
+ c.border_color = border_normal
c:focus_set()
- if floatings[c:name_get():lower()] then
- c:floating_set(true)
+ if floatings[c.name:lower()] then
+ c.floating = true
end
-- Honor size hints
- c:honorsizehints_set(true)
+ c.honorsizehints = true
end
-- Hook function to execute when arranging the screen
-- (tag switch, new client, etc)
function hook_arrange(screen)
local layout = awful.layout.get(screen)
- mylayoutbox[screen].text = "<bg image=\"" .. AWESOME_DATADIR .. "/icons/layouts/" .. layout .. "w.png\" resize=\"true\"/>"
+ mylayoutbox[screen].text = "<bg image=\"@AWESOME_ICON_PATH@/layouts/" .. layout .. "w.png\" resize=\"true\"/>"
-- Uncomment if you want mouse warping
--[[
local sel = client.focus_get()
if sel then
- local c_c = sel:coords_get()
- local m_c = mouse.coords_get()
+ local c_c = sel.coords
+ local m_c = mouse.coords
if m_c.x < c_c.x or m_c.x >= c_c.x + c_c.width or
m_c.y < c_c.y or m_c.y >= c_c.y + c_c.height then
if table.maxn(m_c.buttons) == 0 then
- mouse.coords_set({ x = c_c.x + 5, y = c_c.y + 5})
+ mouse.coords = { x = c_c.x + 5, y = c_c.y + 5}
end
end
end
]]
end
-
-- Hook called every second
function hook_timer ()
-- For unix time_t lovers