(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)

有帮助吗?

解决方案

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top