[download]

local/bin/wmname

   1 #!/bin/bash
   2 
   3 ds=${DESKTOP_SESSION,,}
   4 id=$(xprop -root _NET_SUPPORTING_WM_CHECK | cut -d \# -f 2)
   5 wm=$(xprop -id $id _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