qnikst / kbdd

keyboard library for per-window keyboard layout
GNU General Public License v2.0
146 stars 16 forks source link

add systemd bus activation support #38

Closed zabbal closed 7 years ago

zabbal commented 9 years ago

Since kbdd is all about corresponding dbus service would be nice to add bus activation support so systemd could start it automatically when corresponding dbus calls are invoked.

See https://fedoraproject.org/wiki/Packaging:Guidelines:Systemd#DBus_activation for example.

This would simplify maintenance and make integration with user sessions much easier and DE agnostic.

amerlyq commented 8 years ago

I spent much time pondering about this so-called dbus activation. Isn't it unreasonable in case of kbdd?

What I'm talking about: there are two cases involving kbdd -- focusing X windows and switching layout for current window.

In case of focusing windows -- kbdd must be started as soon, as first window opened in tiling wm, or in case of DE -- immediately on desktop start. Alright, lets loose conditions -- start kbdd only when focusing to another window -- but then it will be launched on second window open, not much profit for us either.

For switching layout it's supposed to start on first layout change by user. But it won't work that way anyway. Because we don't know default layout to switch to when refocusing to other windows, after layout in current one was changed. Alright, lets monitor all layout changes by setxkbmap and xkbload. But, as most users call it on startup, there are again no sense in dbus activation -- as we can run kbdd from the same script.

Sometime layout is set through xorg.conf -- then what left to us is only polling default layout on kbdd start -- is it possible at all? Rather, isn't layout already switched and default layout lost at the moment dbus delivers message to kbdd?

And even if polling will work that way -- what if layout was already changed system-wide several times through terminal for some reasons? Then on kbdd start all windows will acquire the same default layout as last active layout. Unreasonable and unintuitive.

Therefore there is no much sense in dbus activation. Close issue?

zabbal commented 7 years ago

Thanks for detailed explanation, seems reasonable.

zabbal commented 7 years ago

Thanks for detailed explanation, seems reasonable.