home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / useful / reviews / addicons.sh < prev    next >
Text File  |  1995-01-26  |  6KB  |  119 lines

  1. # This script finds all files in the reviews directory, adds an
  2. # appropriate icon file for them (either text reader or directory),
  3. # and then attempts to layout the icons so that they need only minor
  4. # manual touchups.
  5. #
  6. # Thus when the a new archive of reviews is received, they can be
  7. # unpacked in this tree, this script can be run to do 90% of the
  8. # work of updating the tree, and then some minor touchups can be
  9. # done manually (such as adjusting the size of windows for
  10. # directories that now have more files), with some changes folded
  11. # back into this script so that they don't have to be done again
  12. # next time.
  13.  
  14. # First get a list of all the files, then toss out some names
  15. # that we know don't need icons or are icons.
  16.  
  17. find . -print | sort -f | sed "s:^./::" >/tmp/all.tmp
  18. sed -e "/^\.$/d" -e "/\.info$/d" -e "/^AddIcons.sh/d" \
  19.     -e "/\.jpg$/d" -e "/\.iff$/d" -e "/\.uu$/d" \
  20.     -e "/\.gif$/d" -e "/Product-Info$/d" -e "/\.ps$/d" \
  21.     </tmp/all.tmp >/tmp/all.tmp2
  22.  
  23. # For each of the remaining names, clone the current 00-README.info file
  24. # for text files or the doc.info file for directories.
  25.  
  26. for name in `cat /tmp/all.tmp2`
  27. do
  28.     if test ! -f $name.info ; then
  29.         if test -f $name ; then
  30.             echo "cp 00-README.info $name.info"
  31.             cp 00-README.info $name.info
  32.         elif test -d $name ; then
  33.             echo "cp doc.info $name.info"
  34.             cp doc.info $name.info
  35.         fi
  36.     fi
  37. done
  38.  
  39. # Now go reposition the icons.
  40.  
  41. find . -type d -print | sort -f | sed "s:^./::" >/tmp/dirlist
  42.  
  43. for dir in `cat /tmp/dirlist`
  44. do
  45.     # Supply a default layout.
  46.     case "${dir}" in
  47.         .)    layout="-y 40 -Y 22 -x 120 -X 40 -N 5" ;;
  48.         *)    layout="-y 50 -Y 12 -x 200 -X 60 -N 3" ;;
  49.     esac
  50.     # Supply a geometry for the drawer window, and a custom
  51.     # layout if necessary.
  52.     case "${dir}" in
  53.         .)            geometry="DXPOS 0 DYPOS 22 DWIDTH 654 DHEIGHT 123"
  54.                     layout="-y 40 -Y 22 -x 120 -X 40 -N 5" ;;
  55.         doc)            geometry="DXPOS 0 DYPOS 33 DWIDTH 624 DHEIGHT 183" ;;
  56.         hardware)        geometry="DXPOS 0 DYPOS 33 DWIDTH 654 DHEIGHT 243"
  57.                     layout="-y 40 -Y 22 -x 120 -X 40 -N 5" ;;
  58.         hardware/accelerators)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 483" ;;
  59.         hardware/audio)        geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 183" ;;
  60.         hardware/cd-rom)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 233" ;;
  61.         hardware/computers)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 233" ;;
  62.         hardware/copiers)    geometry="DXPOS 0 DYPOS 11 DWIDTH 417 DHEIGHT 83" ;;
  63.         hardware/datacomm)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 83" ;;
  64.         hardware/debug)        geometry="DXPOS 0 DYPOS 11 DWIDTH 215 DHEIGHT 83" ;;
  65.         hardware/emulation)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 233" ;;
  66.         hardware/graphics)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 333" ;;
  67.         hardware/ide)        geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 83" ;;
  68.         hardware/input-devices)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 233" ;;
  69.         hardware/memory)    geometry="DXPOS 0 DYPOS 11 DWIDTH 417 DHEIGHT 83" ;;
  70.         hardware/monitors)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 83" ;;
  71.         hardware/ports)        geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 183" ;;
  72.         hardware/power)        geometry="DXPOS 0 DYPOS 11 DWIDTH 417 DHEIGHT 83" ;;
  73.         hardware/projects)    geometry="DXPOS 0 DYPOS 11 DWIDTH 215 DHEIGHT 83" ;;
  74.         hardware/rom-switchers)    geometry="DXPOS 0 DYPOS 11 DWIDTH 417 DHEIGHT 83" ;;
  75.         hardware/scsi)        geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 133" ;;
  76.         hardware/storage)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 233" ;;
  77.  
  78.         other-reviews)        geometry="DXPOS 0 DYPOS 33 DWIDTH 654 DHEIGHT 123"
  79.                     layout="-y 40 -Y 22 -x 120 -X 40 -N 5" ;;
  80.         other-reviews/april-fools) geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 133" ;;
  81.         other-reviews/books)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 133" ;;
  82.         other-reviews/conferences) geometry="DXPOS 0 DYPOS 11 DWIDTH 215 DHEIGHT 83" ;;
  83.         other-reviews/magazines) geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 133" ;;
  84.         other-reviews/shows)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 83" ;;
  85.         other-reviews/vendors)    geometry="DXPOS 0 DYPOS 11 DWIDTH 417 DHEIGHT 83" ;;
  86.  
  87.         software)        geometry="DXPOS 0 DYPOS 33 DWIDTH 654 DHEIGHT 203"
  88.                     layout="-y 40 -Y 22 -x 120 -X 40 -N 5" ;;
  89.         software/amigados)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 133" ;;
  90.         software/audio)        geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 183" ;;
  91.         software/business)    geometry="DXPOS 0 DYPOS 11 DWIDTH 215 DHEIGHT 83" ;;
  92.         software/calendar)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 83" ;;
  93.         software/cd-rom)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 583" ;;
  94.         software/database)    geometry="DXPOS 0 DYPOS 11 DWIDTH 417 DHEIGHT 83" ;;
  95.         software/datacomm)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 183" ;;
  96.         software/disk)        geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 333" ;;
  97.         software/gag)        geometry="DXPOS 0 DYPOS 11 DWIDTH 417 DHEIGHT 83" ;;
  98.         software/games)        geometry="DXPOS 0 DYPOS 11 DWIDTH 1037 DHEIGHT 889"
  99.                     layout="-y 50 -Y 12 -x 200 -X 60 -N 5" ;;
  100.         software/graphics)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 483" ;;
  101.         software/graphics/raist) geometry="DXPOS 0 DYPOS 11 DWIDTH 264 DHEIGHT 118"
  102.                     layout="-y 40 -Y 12 -x 120 -X 40 -N 5" ;;
  103.         software/multimedia)    geometry="DXPOS 0 DYPOS 11 DWIDTH 417 DHEIGHT 83" ;;
  104.         software/printing)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 133" ;;
  105.         software/programmer)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 383" ;;
  106.         software/science)    geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 133" ;;
  107.         software/shell)        geometry="DXPOS 0 DYPOS 11 DWIDTH 417 DHEIGHT 83" ;;
  108.         software/text)        geometry="DXPOS 0 DYPOS 11 DWIDTH 624 DHEIGHT 383" ;;
  109.         software/text/hagen)    geometry="DXPOS 0 DYPOS 11 DWIDTH 215 DHEIGHT 83" ;;
  110.         software/unix)        geometry="DXPOS 0 DYPOS 11 DWIDTH 417 DHEIGHT 83" ;;
  111.     esac
  112.     dirpath=`(cd $dir; pwd) | sed -e "s:^/::" -e "s@/@:@"`
  113.     echo "======"
  114.     iconpos "$dirpath" $geometry
  115.     (cd $dir && pwd && \
  116.      ls *.info | sort -f | placeicons $layout >/tmp/runme && \
  117.      sh /tmp/runme)
  118. done
  119.