[download]

local/bin/wmname

   1 #!/bin/bash
   2 
   3 ds=${DESKTOP_SESSION,,}
   4 wm=$(xprop -id $(xprop -root _NET_SUPPORTING_WM_CHECK |
   5 cut -d \# -f 2) _NET_WM_NAME | cut -d \" -f 2 | tr A-Z a-z)
   6 
   7 [[ $wm ]] || exit 1
   8 [[ $ds && $ds != $wm ]] &&
   9 echo $ds:$wm  ||  echo $wm