How to detect Window Manager
detect() {
# Mate = Marco
# Gnome2 = Metacity
# Gnome3 = Mutter
# Xfce4 = Xfwm4
# KDE4 = KWin
WM_WINDOW=$(xprop -root _NET_SUPPORTING_WM_CHECK);
WM_WINDOW=${WM_WINDOW##* };
WM_NAME=$(xprop -id $WM_WINDOW 8s _NET_WM_NAME)
WM_NAME=${WM_NAME##* };
echo $WM_NAME | sed 's/"//g'
}
This code will return the codename of the WM.
More informations => https://bobotig.fr/index.php?c=documents/fond-ecran-cli/
Written by Mickaël S.
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#