sxhkd icon indicating copy to clipboard operation
sxhkd copied to clipboard

Focusing windows in most-recently-used order

Open jhyeon opened this issue 9 years ago • 2 comments

I am trying to implement Windows-style windows switching in the most-recently-used order. For this, I have the following lines in ~/.config/sxhkd/sxhkdrc:

{_,shift + }{_,ctrl + }{Super_L,Super_R}
    bspc wm --record-history off

{_,shift + }{_,ctrl + }@{Super_L,Super_R}
    bspc wm --record-history on; \
    bspc node -f focused

super + {_,shift + }{_,ctrl + }Tab
    bspc node -f {older,newer}{.local,_}

This works the way I want. Now, the challenge is to let sxhkd replay the events specified in the first two stanzas above. I tried putting ~ in front of the keysyms in the first line like:

{_,shift + }{_,ctrl + }~{Super_L,Super_R}

Then, the KeyPress and KeyRelease events are replayed, but the second stanza seems to be ignored. Is there a way to implement Windows-style super+Tab while replaying the modifier key events?

jhyeon avatar Dec 24 '15 08:12 jhyeon

I pulled commit 5693b4faabb9eef9b916df326405d9b025a2f4c8, and compiled it with make debug. If I insert ~ before {Super_L,Super_R}, then sxhkd does not execute the commands bound to the release of those keys, and the output looks like

key press 133 0
key press 133 0
key press 133 0
key press 133 0

when I press Super_L repeatedly. Nevertheless, xev reports KeyRelease as well as KeyPress of Super_L. This happens whether I put ~ in front of @{Super_L,Super_R} or not. If I remove the ~, the output becomes

key press 133 0
key release 133 0
key press 133 0
key release 133 0

and the commands on Super_L release work.

jhyeon avatar Dec 27 '15 14:12 jhyeon

There are other applications that support windows-style window switching, one such being Rofi. Does this solve your issue?

jallbrit avatar Aug 05 '20 01:08 jallbrit