Question

(On a Linux, for a shell running in a terminal emulator in a graphical server,) I'm interested in knowing how to determine in which Window manager the shell is running.
Thanks

(I want that for my .bashrc)

Était-ce utile?

La solution

wmctrl -m | grep Name | cut -d: -f2 seems to give the right answer. But it is not necessarily installed.

xlsclients lists all X clients in the current display (including the window manager) which may be useful, but you'll need to know a list of possible window managers to make a positive identification. e.g

xlsclients | grep -e compiz -e xfwm4
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top