#!/bin/csh -f
#
# Print array whose length is number of screens and whose
# elements are 1 if the screen is color or 0 otherwise.
#
set displays
set disp = $DISPLAY
set disp = $disp:r
set i = 0
while (! $?done)
   set xrdb = `sh -c "xrdb -symbols -display ${disp}.$i 2>/dev/null"`
   if ($status) then
      set done
   else
      set color = `echo $xrdb | grep -c COLOR`
      set displays = ($displays $color)
      @ i++
   endif
end

echo $displays
exit 0

