sunaku / wmiirc

Ruby configuration for WMII window manager
ISC License
82 stars 26 forks source link

removing imported keyboard shortcats #13

Closed wabu closed 14 years ago

wabu commented 14 years ago

when importing a keyboard files, one can customize some shortcuts by overriding them, but removing an imported shortcut is impossible, as the yaml merge algorithm ignores nil values.

wabu commented 14 years ago

wabu@011e9f0b202a7c9c0c7c23a35c78908aba6f3fce changes the merge algorithm to be able to remove entries. the only problem now is you should not have empty entries in your config.yaml if you don't want to override anything.

wabu commented 14 years ago

with wabu@7cf2b9fe95ef6782efc5d6b62a7fa12c38ddc550 only entries with primitive values can be removed

nougad commented 14 years ago

In my opinion the Patch is useful anyway but perhaps the problem goes deeper.

Perhaps it is a good idea to split the complete keybinding into smaller chunks and only use a minimal subset as default. I really love this config and use it everyday but I only use a small subset of features/keybinding because very much is included per default. It's hard to memorize key combination's such as Mod1-Shift-z,t

My proposal for a layout:

control/ ├── action.yaml ├── keyboard │   ├── dvorak.yaml │   ├── neo2.yaml │   ├── qwerty │   │   ├── detach.yaml │   │   ├── grouping.yaml │ │ ├── launch.yaml │   │   └── ... │   └── qwerty.yaml ├── mouse.yaml └── workdir.yaml

What do you think about that?

sunaku commented 14 years ago

Agreed, I prefer the approach of dividing the keybindings into smaller subsets too. That directory structure looks good, please proceed. And apologies for the eccentric keybindings (I use a Kinesis Advantage keyboard).

nougad commented 14 years ago

Ok, here comes my proposal: http://github.com/nougad/wmiirc/commit/e5bf21f85865d3217dcc3105f21e3ccdf6c2b087

Sorry for such a gigantic commit. But smaller chunks makes in this case no sense.

I only tested my qwerty keybinding.

What do you think about the include and generic folder? I think it's a little bit ugly to have two different folder but better than redundant code. An other Idea are symlinks from generic/* into qwerty/* for example.

sunaku commented 14 years ago

I think we can use a single generic/ folder instead of the include/. I'm currently building on your commit by splitting up the control/action partial and importing it into the various keybinding partials.

nougad commented 14 years ago

I thought about splitting action too, but actions can be called by multiple events except Keys. For example someone have a button in status bar or call an action with the action menu. I think every time should all actions be included.

The difference between generic and include was that files in included added automatically and generic must be included manually. But it is ok to merge both into generic.

sunaku commented 14 years ago

@nougad Your commit is merged into master.

@wabu The ability to nullify a previous key during merge seems useful for other purposes. I'll try to merge your commits tomorrow.

sunaku commented 14 years ago

Although this minimal subset approach increases the complexity of the overall configuration, it makes it really easy to diff the various keybindings. Try it; I'm surprised how similar they are.

sunaku commented 14 years ago

wabu: I have merged your commit at sunaku/wmiirc@285683326f3cb0ac8f482d37d8a1f8e10fb26e3d

Please verify and close this issue. Thanks.

wabu commented 14 years ago

splitting the keybindings and undefining a value both help, thanks.