For global use by keyword
at the end of your rc.lua you have the function client.add_signal(... , inside this function you have to set the last line of the FAQ, to enable it for only particular applications I included a new variable at the beginning of rc.lua `
local undermouse = false
than the part of the FAQ:
client.add_signal("manage", function (c, startup)
-- Add a titlebar
-- awful.titlebar.add(c, { modkey = modkey })
-- Enable sloppy focus
c:add_signal("mouse::enter", function(c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
client.focus = c
end
end)
if not startup then
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- awful.client.setslave(c)
-- Put windows in a smart way, only if they does not set an initial position.
if not c.size_hints.user_position and not c.size_hints.program_position then
awful.placement.no_overlap(c)
awful.placement.no_offscreen(c)
=> if underMouse == true then
=> awful.placement.under_mouse(c)
=> underMouse = false
=> end
end
end
end)
to use this option I created the next code for my calculater key:
globalkeys = awful.util.table.join(
awful.key({ }, "#148", function ()
underMouse = true
awful.util.spawn(calculator)
end),
)
As a rule for 1 application
as found by yourself after testing my solution, but added to this answer for use for other people:
{ rule = { class = "Gnome-calculator", },
properties = {
floating = true,
callback = function(c) awful.placement.under_mouse(c) end,
},
},