baverman / orcsome

Scripting extension for NETWM compliant window managers
MIT License
28 stars 3 forks source link

[feature request] Emacs-like keybindings #4

Open paul-axe opened 8 years ago

paul-axe commented 8 years ago

Hi. It would be great to support Emacs-like keybinding like "Alt+o p" in orcsome. In your orcsome config file i see this kind of binding, and there is something similar in projects source code, but it seems like not working yet.

baverman commented 8 years ago

I wanted to implement key chains a long time ago but faced with some difficulties (lack of deep X Window knowledge). I'll give it a try on these weekends. Thank you for reminder)

paul-axe commented 8 years ago

I have this part of code, which implements key chains, in my config now. Maybe i'll will help.

@wm.on_key("Alt+o")
def prefix():
    def handler(is_press, state, code):
        if is_press:
            if wm.keycode("p") == code:
                wm.spawn(TERMINAL)
            else:
                wm.ungrab_keyboard()
    wm.grab_keyboard(handler)
baverman commented 8 years ago

At this level, yes, it can be implemented. Ideally I want some sort of OSD to show current chain context. May be showing it in notification area will be enough.