0

My problem is that the basic option to make keybindings in Awesome WM (Window Manager), awful.key(), doesn't work for keybindings like [super+d, e] or [super+d, super+r].

I found a way to do it, but is impractical. Maybe some parameter of "awful.keygrabber" works, but I can't find much information about its behavior.

Marshelo
  • 11
  • 2

1 Answers1

0

This is how:

awful.keygrabber {
    start_callback = function() --[[do something]]  end,
    stop_callback  = function() --[[do something]] end,

    -- You might want to avoid `export_keybindings` if you want
    -- a single point of entry. If so, they use a normal `awful.key`
    -- to start the keygrabber.
    export_keybindings = true,

    -- This is the important part, it releases the keygrabber
    -- when `Super` is released. If you don't want this and
    -- release when an unrelated key  is pressed, do it 
    -- with `keypressed_callback` instead.
    stop_event = "release",
    stop_key = {"Escape", "Super_L", "Super_R"},

    keybindings = {
        {{ modkey } , "d" , function()
            --[[do something]]
        end},
        {{ modkey } , "e" , function()
            --[[do something]]
        end},
    }
}
  • but this make 2 different shortcuts: [super+d] and [super+e], and each one with its function. I want something like press first [super+d] then [super+e] and do something, but if I don't press [super+d] first it shouldn't work. – Marshelo Dec 05 '22 at 04:03
  • Then use an `awful.key` to start the keygrabber and remove `export_keybindings`. See the code comment. – Emmanuel Lepage Vallee Dec 05 '22 at 04:47