svenstaro / wmfocus

Visually focus windows by label
MIT License
220 stars 20 forks source link

How is a feature correctly added to wmfocus? #128

Open ortango opened 2 years ago

ortango commented 2 years ago

After attempting to add bspwm support for wmfocus i've run into an issue building the project with all features enabled. what would be the proper way to add an additional feature?

I also wonder if there is need for a function that would enable switching wm's provider at runtime? whether it is through a user specified choice or automatically by querying _NET_SUPPORTING_WM_CHECK.

svenstaro commented 2 years ago

Hm yeah I might have to rethink the feature system. The idea was to not require all possible C interfaces for all possible WMs to be installed as that would be rather inconvenient. However, currently on the flip side this means that you can only build wmfocus with a single WM feature at a time. I realize this might be inconvenient. Due to a lack of time, I'd be happy for suggestions here.

ortango commented 2 years ago

i'm not experienced enough with rust to make qualified suggestions on this. the simplest solutions i can come up with avoiding some type of plugin system:

markstos commented 2 years ago

This relates to https://github.com/svenstaro/wmfocus/pull/138 where Sway is implemented as a separate "feature" from i3, so they both can't be compiled at the same time. That would be inconvenient if you switch between Sway and i3. I only use Sway now, but for a period I did switch back and forth.

I'm a beginner Rust developer, so my best idea to deal with was was compile multiple OS packages, one for each "feature". All would generate a "wmfocus" binary.

Another idea is to simply encourage installation using cargo instead of an OS package manager, and have people enable whichever WM they need that way.