Saturday, April 02, 2011

what window manager am I running?

Recently, I've installed quite a few new Linux distributions as virtual machines. They all use different window managers and it is difficult to tell what window manager I have installed. The "wmctrl" program clears this fog. Run the command like this:
sodo@linux-nie4:~> wmctrl -m
Name: Metacity
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: OFF


Et voila! You have the name of your window manager. Also, you could grep your process list for a known window manager like metacity or compiz like so:
sodo@linux-nie4:~> pidof metacity
5134
sodo@linux-nie4:~> ps -ef | grep metacity
sodo 5134 4984 0 10:36 ? 00:00:01 /usr/bin/metacity
sodo 30798 5467 0 11:35 pts/0 00:00:00 grep metacity


Also, it might be helpful to know your X session setup. This can be determined by looking at your environment variables:
sodo@linux-nie4:~> printenv | egrep 'MANAGER|SESSION' | sort
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-1UXtH7rCgE,guid=9b7438cbc749781f920116e54d973474
DESKTOP_SESSION=gnome
GDMSESSION=gnome
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
SESSION_MANAGER=local/linux-nie4:@/tmp/.ICE-unix/4984,unix/linux-nie4:/tmp/.ICE-unix/4984
WINDOWMANAGER=/usr/bin/gnome
XDG_SESSION_COOKIE=74cab8c1ad6aab7a0cf6c38f4d8dc6fa-1301754995.529512-1092139338
XSESSION_IS_UP=yes


A KDE Example
sodo@linux-z6tw:~> printenv | egrep 'MANAGER|SESSION' | sort
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-mzeA1Sx0fF,guid=43e3b1dcb893bbe684e0bdfe00001fe6
DESKTOP_SESSION=default
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSION=4
KONSOLE_DBUS_SESSION=/Sessions/1
SESSION_MANAGER=local/linux-z6tw:@/tmp/.ICE-unix/11242,unix/linux-z6tw:/tmp/.ICE-unix/11242
SHELL_SESSION_ID=985449ee0b7140008fe9978a32662d10
WINDOWMANAGER=/usr/bin/startkde
XDG_SESSION_COOKIE=6b050dcfcaf094a4a7c7a30e000002ae-1301545596.870464-842889003
XSESSION_IS_UP=yes

sfrase@linux-z6tw:~> wmctrl -m
Name: KWin
Class: kwin
PID: 11247
Window manager's "showing the desktop" mode: OFF


cool.
TAG

No comments:

Feel free to drop me a line or ask me a question.