Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How is a feature correctly added to wmfocus? #128

Open
ortango opened this issue Jan 15, 2022 · 3 comments
Open

How is a feature correctly added to wmfocus? #128

ortango opened this issue Jan 15, 2022 · 3 comments

Comments

@ortango
Copy link

ortango commented Jan 15, 2022

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
Copy link
Owner

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
Copy link
Author

ortango commented Jan 21, 2022

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:

  • compile conflicts with multiple features:
    like here. this wouldn't really change much, but it would be more explicit. not really compatible with packaging.
  • build all features and call crate::get_desktops() based on user config:
    i was thinking of moving all this to wm.rs and having a "provider" enum with #[cfgs determining the current features. is there a decent way to do this without duplicated #[cfg directives in get_desktop() and focus_window().

@markstos
Copy link

This relates to #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants