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

Support for EWMH-compliant WMs #4

Open
b0o opened this issue Sep 30, 2018 · 11 comments
Open

Support for EWMH-compliant WMs #4

b0o opened this issue Sep 30, 2018 · 11 comments

Comments

@b0o
Copy link

b0o commented Sep 30, 2018

The EWMH specification defines a set of interactions between window managers and external tools like docks, status bars, and other desktop-environment related utilities.

An incomplete list of EWMH-compliant window managers is (via Wikipedia):

  • aewm
  • awesome
  • i3
  • xmonad (needs to be turned on in the config)
  • wmii
  • goomwwm
  • spectrwm
  • Blackbox
  • Compiz
  • CTWM (as of 4.0.0)
  • edewm
  • Fluxbox
  • FVWM (via a plugin prior to v2.4 and native support from v2.5)
  • JWM
  • KWin
  • Metacity
  • Openbox
  • Enlightenment (E16 and E17)
  • evilwm
  • fwm (via a plugin)
  • interfacewm
  • matchbox
  • Sawfish (not completely)
  • wmfs
  • Xfwm

There is a Rust package, xcb-util, which provides a wrapper around the Linux libxcb-util (X protocol C-language Binding), including a wrapper around the libxcb-util EWMH implementation.

A quick glance at the package leads me to believe it provides the necessary functionality to create an EWMH implementation of wmfocus.

@svenstaro
Copy link
Owner

Yeah, that's my hope as well. Do you wanna take a stab at this?

@b0o
Copy link
Author

b0o commented Sep 30, 2018

@svenstaro I've honestly never written Rust, but I may give it a go if I have some free time.

@svenstaro
Copy link
Owner

svenstaro commented Sep 30, 2018

I don't really know how to get a list of visible windows on all currently visible desktops using xcb/xlib and there is no obvious way that I can see. Any idea?

@b0o
Copy link
Author

b0o commented Oct 2, 2018

Hmm, good point. I can only figure out how to determine the active desktop, list all desktops and the windows on them, but not necessarily a straightforward way to definitively determine if any given window is visible.

By playing around with wmctrl, xdotool, and xprop, and examining their sources, I can determine:

This is about all the time I have time to dig in right now, maybe this gives you some ideas?

@t-wissmann
Copy link

t-wissmann commented Apr 23, 2020

I don't really know how to get a list of visible windows on all currently visible desktops using xcb/xlib and there is no obvious way that I can see. Any idea?

You simply need to iterate over all windows mentioned in _NET_CLIENT_LIST (all windows, as specified by EWMH) and for each window check whether the first entry of WM_STATE is 1 ("NormalState", i.e. not Iconic or Withdrawn; specified by ICCCM). This gives you all visible windows.

@rdiaz02
Copy link

rdiaz02 commented Oct 28, 2021

In https://www.reddit.com/r/bspwm/comments/qf0jd5/switching_and_swapping_windows_with/hi9ppyy/ @ortango has provided code that allows wmfocus to be used from bspwm . (This is also available with the additional needed modifications in Cargo.toml and main.rs from https://github.com/rdiaz02/wmfocus/tree/stdin ) .

@svenstaro
Copy link
Owner

I'd definitely accept a patch but with bspwm I suppose the bspwm client tool should be called in get_windows(). I suppose overall it wouldn't be too hard to integrate. The posted patch does things in a fairly awkward way and needs to be done differently.

@rdiaz02
Copy link

rdiaz02 commented Nov 3, 2021

Sure, I understand. However, I am not the author of the patch, and I know no Rust, and almost no bspc, so I won't be able to contribute this anytime soon. The intention of posting it here and placing it in a repo was so that other people searching around could find it (either for using as is, or for preparing a patch that could be integrated).

@svenstaro
Copy link
Owner

I might try but then again I don't really run bspwm anymore and I can't support the feature so well. It'd be much better added and maintained by someone who uses it as their daily driver.

@rdiaz02
Copy link

rdiaz02 commented Nov 3, 2021

That would be great (I plan on moving to bspwm around Christmas, so I could test it and I assume many other bspwm users would be interested). And, of course, I understand that ideally this would be added and maintained by someone who uses bspwm daily.

@DeafMan1983
Copy link

Sorry it is old. I know far. I would like to suggest about libxcb and xcb's extensions from gitlab should to compile with --enable-static --enable-shared if you have to test with Rust then you would like to publish as end-usable program without required libxcb or xcb's extensions ( You just can compile with gcc -Wl,-Bstatic lxcb -lXau -lXdmcp -lxcb-util (....) -Wl,-Bdynamic -lc (....) means other xcb's extensions like xcb-image, xcb-cursor, xcb-composite etc... they should to be statical in Rust program and you won't to get worry.

Or I have made with C# Dotnet 7.0/8.0 and it is very beautiful single executable.

Please remember that:
You can check in terminal:
LD_LIBRARY_PATH=. ./your_rust_program
If your_rust_program throws errors cause your_rust_program doesn't build with statical libxcb.a etc ....

I hope you understand my suggestion and my suggestion helps you. Sorry my bad English...

Best regards!

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

5 participants