Posted to tcl by patthoyts at Wed Apr 09 13:25:58 GMT 2008view raw

  1. # Use the Extended Window Manager Hints properties to find out the
  2. # name of the current window manager.
  3. proc get_wm_name {} {
  4. set result {}
  5. set atom _NET_SUPPORTING_WM_CHECK
  6. if {![catch {exec xprop -root -f $atom 32x " \$0+" $atom} check]} {
  7. set wid [lindex $check 1]
  8. set atom _NET_WM_NAME
  9. if {![catch {exec xprop -id $wid -f $atom 8t " \$0+" $atom} name]} {
  10. set result [lindex $name 1]
  11. }
  12. }
  13. return $result
  14. }