home *** CD-ROM | disk | FTP | other *** search
/ Executor 2.0 / executorv2.0.iso / pc / linux / extra / docs / maillist / text / archive.96 / text1133.txt < prev    next >
Encoding:
Text File  |  1996-07-25  |  2.8 KB  |  107 lines

  1. Mat Hostetter (mat@ardi.com) wrote:
  2. : >>>>> "zinc" == zinc  <zinc@zifi.genetics.utah.edu> writes:
  3.  
  4. :     zinc> is it possible to change the color used by programs such as
  5. :     zinc> Word or KaleidaGraph for selected text?  on my system the
  6. :     zinc> default is a bright yellow which isn't too bad but i usually
  7. :     zinc> like more mellow colors.
  8.  
  9. :     zinc> this is with E/L 1.99q7 (ELF) Linux 1.3.70 X-Windows
  10.  
  11. : On a Mac the highlighting color is stored as a 6-byte RGB value at
  12. : address 0xDA0.  Executor sets that to R:G:B = 0xFFFF:0xFFFF:0x0000 by
  13. : default (bright yellow).
  14.  
  15. : Someone could probably write a desk accessory to let you change this
  16. : value.  Since you're using Linux, I suppose you could change the value
  17. : of the memory locations holding the highlight color in gdb.  Heh.
  18.  
  19.     *laugh*  Okay, I tried it and it works.
  20.  
  21. Here's a script to run executor under Linux with a selection color
  22. of your choice. :)  GDB is pretty awesome.
  23.  
  24. Usage: ehigh [-svga] colorname
  25.  
  26. "colorname" can be any color that is recognized by X11 programs.
  27.  
  28. See ya!
  29.  
  30.     -Sam Lantinga            (slouken@cs.ucdavis.edu)
  31.  
  32. -----------------------------------------------------------------
  33. -- Save the following script to a file named 'ehigh' and then run
  34.    chmod 755 ehigh
  35. -- Note that this is just a hack, and isn't supported. :)
  36. -----------------------------------------------------------------
  37. #!/bin/sh
  38. #
  39. # This is a script to change the highlight color of executor, the
  40. # Macintosh emulator from ARDI.
  41. #
  42. # Note that the Macintosh color palette differs greatly from that
  43. # of the X11 standard colors, so the color you get might not be
  44. # the color you expect. :-)
  45. #
  46. # It's a hack, and not supported in any way. :)
  47.  
  48.  
  49. # Choose your executor!
  50. binary=/usr/local/bin/executor
  51. if [ "$1" = "-svga" ]; then
  52.     echo "WARNING!"
  53.     echo "-- Modifying executor-svga can cause your system to freeze!"
  54.     echo ""
  55.     echo -n "Press Ctrl-C to abort: "
  56.     read junk
  57.     binary=/usr/local/bin/executor-svga
  58.     shift
  59. fi
  60.  
  61. # Get the color highlight value
  62. rgbtxt=/usr/lib/X11/rgb.txt
  63. if [ "$1" = "" ]; then
  64.     value1=0xFFFF
  65.     value2=0xFFFF
  66.     value3=0x0000
  67. else
  68.     color=`egrep "    $1$" $rgbtxt`
  69.     if [ "$color" = "" ]; then
  70.         (echo "Color '$1' not found!";
  71.          echo "Possible matches:"
  72.          fgrep -i "$1" $rgbtxt
  73.         ) | less
  74.         exit
  75.     fi
  76.     value1=`echo "$color" |
  77.         awk '{printf("0x%2x%2x",\$1,\$1)}' | sed 's/ /0/g'`
  78.     value2=`echo "$color" |
  79.         awk '{printf("0x%2x%2x",\$2,\$2)}' | sed 's/ /0/g'`
  80.     value3=`echo "$color" |
  81.         awk '{printf("0x%2x%2x",\$3,\$3)}' | sed 's/ /0/g'`
  82. fi
  83.  
  84. # Save our script...
  85. cat >$HOME/Delete_ME <<__EOF__
  86. file $binary
  87. break mmap
  88. run
  89. c
  90. x/3h 0xDA0
  91. set variable *0xDA0 = $value1
  92. set variable *0xDA2 = $value2
  93. set variable *0xDA4 = $value3
  94. x/3h 0xDA0
  95. d 1
  96. quit
  97. __EOF__
  98.  
  99. # Run it. :-)
  100. gdb --command=$HOME/Delete_ME
  101. rm -f $HOME/Delete_ME
  102.  
  103. clear
  104. echo "Thank you very much."
  105.  
  106.