sminez / penrose

A library for writing an X11 tiling window manager
https://sminez.github.io/penrose/
MIT License
1.26k stars 88 forks source link

Question: Use xmodmap-pke-umberwm? #285

Closed TornaxO7 closed 10 months ago

TornaxO7 commented 11 months ago

Hi! So currently penrose uses the binary xmodmap in order to get the mappings. Is it somehow possible to use a crate for this (or implement it in penrose itself)? For example https://github.com/yazgoo/xmodmap-pke-umberwm>.

I could volunteer to create a PR for penrose (let it be either by addding a crate or adding the code for it).

And thank you a lot for this! May I ask how you abstracted this project? It was already hard for me to find enough (and especially good) docs about x11 when I started to write a screenshot tool with my friend.

sminez commented 11 months ago

That crate you are suggesting looks to depend on the x11 crate? I'm not keen on pulling in multiple different wrappers around the C x11 libraries so it would need to be done using x11rb if it were to be part of Penrose itself.

Is there a reason why making use of xmodmap isn't possible for you?

In terms of how the project was put together, it was mostly a lot of reading the source of other window managers and the xcb library documentation if I'm honest.

TornaxO7 commented 11 months ago

Is there a reason why making use of xmodmap isn't possible for you?

Well, just less additional external dependencies :D but I understand if this reason is not enough.

In terms of how the project was put together, it was mostly a lot of reading the source of other window managers and the xcb library documentation if I'm honest.

cool

TornaxO7 commented 11 months ago

@sminez so would you be interested in a PR which adds an implementation to penrose for xmodmap with x11rb?

sminez commented 11 months ago

So long as it's functionally equivalent to the results obtained via xmodmap and it doesn't bring in any new dependencies then I think that could be a good addition, yeah 👍

I'm not sure if xmodmap is doing anything under the hood to handle the different ways users can interact with key mappings so it'd be good to confirm what that looks like before starting.