You can then pipe xprop directly to sed to get the display name.