Macchina-CLI / libmacchina

A library providing access to all sorts of system information.
https://crates.io/crates/libmacchina
MIT License
68 stars 20 forks source link

Add xorg window manager detection with xprop #133

Closed Gobidev closed 1 year ago

Gobidev commented 1 year ago

Add another way of optaining the window manager name on Xorg using xprop. This method works on most systems and uses a pre-installed command. If the detection with xprop fails, the previous method of using wmctrl will be tested and errors will only be returned if this also fails.

grtcdr commented 1 year ago

Although I'd love to see a Rust-native implementation so we can finally close #9, this is a welcome change, so thank you!

Gobidev commented 1 year ago

The only Rust-native implementation I can think of would be to scan /proc for known WMs, which would also work for wayland but could not detect WMs that are not hardcoded. However, we could then fallback to using xprop and/or wmctrl, maybe I will look into that in the future.