All pastes #1863344 Raw Edit

Stuff

public shellscript v1 · immutable
#1863344 ·published 2010-04-16 14:48 UTC
rendered paste body
# WM Detection - Begindetectwm () {  WM="Not Found"  userId="$(id -u ${USER})"  for each in $wmnames; do    PID="$(pgrep -U ${userId} $each)"    if $PID; then      if pidof $each >/dev/null; then        case $each in          'fluxbox') WM="FluxBox";;          'openbox') WM="OpenBox";;          'blackbox') WM="blackbox";;          'xfwm4') WM="Xfwm4";;          'metacity') WM="Metacity";;          'kwin') WM="KWin";;          'icewm') WM="IceWM";;          'pekwm') WM="PekWM";;          'fvwm') WM="FVWM";;          'dwm') WM="DWM";;          'awesome') WM="Awesome";;          'WindowMaker') WM="WindowMaker";;        esac      fi    fi  done  [ "$verbosity" -eq "1" ] && verboseOut "Finding window manager...found as '$WM'"}# WM Detection - End