Closed QiangF closed 2 years ago
Ref: #25. This would be nice purely for time savings of course (if no other reasons).
keyszer has python-xlib dependency, it make sense to combine the functionality.
Does it? Just because we have a dep on python-xlib
it does not necessarily follow that it would make sense to add functionality from other software also using the same library... perhaps it's a good idea, perhaps not. Definitely seems a violation of the "separate tools for sep purposes" Unix philosophy.
sometimes when focused window closes, the focus is not on the next top window, eg. focus go to the taskbar. In that case, we can make a function to move the focus back to application window.
I'm not sure how this is a keymappers problem to solve?
function to save new window layout on window change,
This also sounds far out of scope... Keyszer is a keymapper... we only communicate with X to learn the current application to inform our primary purpose - the mapping of keys.
function to auto switch input method, eg. swith to terminal, disable non-english input method.
What does "disable non-english input method" refer to exactly... of course Keyszer can already change modmaps/keymaps depending on the currently active application... This is the only thing you've mentioned that sounds like perhaps it could be in scope (as it's keyboard/input related)...
This is mainly to avoid opening too many X connections. I agree that it's better to put these functions into another script. I have found one example here: https://gist.github.com/ssokolow/e7c9aae63fb7973e4d64cff969a78ae8
There is a package named orcsome that add some window manager hooks with python-xlib. keyszer has python-xlib dependency, it make sense to combine the functionality. Just too more hooks:
focus change hook and add two more function to that hook:
new window or window size change hook and add the following function:
I am not familiar with python-xlib, it might be trivial to add these hooks in the event loop.