0

I want to bind client key to perform some operation on Mod1-q shortcut only in vivaldi browser, so I write in clientkeys config in my rc.lua:

awful.key({"Mod1"}, "q",
function (c)
  if c.class == "Vivaldi-stable" then
    someoperation()
  end
end,
{description = "Some operation only in browser", group = "client"})

The problem with this code is that someoperation() is performed if Mod1+q is pressed in vivaldi browser, but all other window got no input at all, while I want them to receive Mod1+q as before. Is there some obvious way to bind keys only to specific client class, maybe via match function?

sandric
  • 2,310
  • 3
  • 21
  • 26

1 Answers1

1

Add the following to a suitable entry (with class = "Vivaldi[-]stable") to awful.rules:

callback = function(c)
    local keys = c:keys()
    c:keys(gears.table.join(keys,
        awful.key({"Mod1"}, "q", someoperation,
        { description = "Some operation only in browser", group = "client"})))
end
Uli Schlachter
  • 9,337
  • 1
  • 23
  • 39