private.rc
author Stefan Vogel <sv@exept.de>
Tue, 30 Mar 2004 20:41:03 +0200
changeset 617 f6afee16b359
parent 611 2e979d468e0d
child 633 3f33f2ba982f
permissions -rw-r--r--
Add --quick options to come up without gimmicks

"*
 * Encoding: iso8859-1
 *
 * $Header$
 *
 * MIMEType: application/x-smalltalk-source
 *
 * ST/X startup configuration & command file:
 *
 * sample private.rc - file
 *
 * a copy of this file can (should) reside in $home/.smalltalk/private.rc or
 * in the current directory - put all private preferences in here.
 *
 *
 * notice, you will find some things enclosed in
 *  ... thisIsMySystem ifTrue:[
 *  ... claus ifTrue:[
 *
 * these are my personal preferences which will be
 * ignored in your environment, but are taken in mine.
 * That way, I dont have to maintain two different 'private.rc' files.
 * (you may want to have a look into it - some is of general interest)
 *"

"/
"/ define the language (you can also set the LANG-shell variable)
"/ (currently #en, #de and #fr are supported).
"/ some fragments for other languages (japanese ;-) exist.
"/ Setting it here will override the LANG variable setting,
"/ if neither set here nor in LANG, #english is the default.
"/ see (and enhance) the resource files
"/
"/ Smalltalk language:#de.
"/ Smalltalk language:#en.

"/
"/ you may limit the amount of memory allocated to
"/ dynamic compiled code ...
"/ The default is unlimited;
"/ If you run in a multiuser environment, or
"/ short on swapSpace, a good limit is some 0.5 to 1Mb.
"/

"/ ObjectMemory dynamicCodeLimit:500000.

"/
"/ If local sources should have preference over source code management
"/ (only useful, if you have the full version (including sourceCode mgmnt),
"/ and CVS access is slow.
"/
"/ Class tryLocalSourceFirst:true.

"/
"/ this turns off error/fatal messages from the VM
"/ (it does not really make sense to turn them off)
"/
"/ Smalltalk debugPrinting:false.

"/
"/ set the package for fileIns done below
"/
Project notNil ifTrue:[
    |p|

    p := Project new.
    p package:#'goody-fileIn'.
    p comment:'only for goodies'.
    Project current:p.
].
!

|whoAmI domain thisIsMySystem thisIsExeptsDomain conf systemType incDir includes|

whoAmI := OperatingSystem getLoginName.
domain := OperatingSystem getDomainName.
thisIsExeptsDomain := (domain = 'exept.de').
thisIsMySystem := (whoAmI = 'cg') and:[thisIsExeptsDomain].

"/
"/ no matter what the 'display.rc' says:
"/     I want my #iris style ...
"/     except for win systems, where I use the win95 style
"/

thisIsMySystem ifTrue:[
    Display hasGrayscales ifTrue:[
	OperatingSystem getOSType = 'win32' ifTrue:[
	    View defaultStyle:#mswindows95
	] ifFalse:[
	    View defaultStyle:#iris.
	    "/
	    "/ or whatever you like as default ...
	    "/
	    "/ View defaultStyle:#motif.
	]
    ] ifFalse:[
	View defaultStyle:#normal
    ].
].

thisIsMySystem ifTrue:[
    "/
    "/ I want the hostname to be prepended to a windows label
    "/
    StandardSystemView includeHostNameInLabel:true.
].

thisIsMySystem ifTrue:[
    "/
    "/ I prefer a smaller menu font
    "/
    "/ MenuView defaultFont:(MenuView defaultFont size:10).
].

"/ add my private directories to the searchPath ...
"/ This does not make sense in your environment.
"/ However, I leave the code here to show how its done.
"/
thisIsMySystem ifTrue:[
    #(
	'../../not_delivered'
	'../../private_classes'
	'../../fileIn/not_delivered'
	'../../libpro'
     ) do:[:p |
	p asFilename exists ifTrue:[
	    Smalltalk systemPath addFirst:p.
	]
    ].
].

"/ since smalltalk keeps track of which directories exist
"/ in the path, this cache has to be flushed whenever new directories
"/ are added to the system path:
"/
Smalltalk flushPathCaches.

"/
"/ color allocation strategy:
"/
"/ the default is to allocate from the colormap as required.
"/ As long as the number of distinct colors used is less than the number
"/ of available colors (which is usually the case) this leads to better looking
"/ images.
"/ However, if many images are to be displayed simulatiously, images displayed
"/ first may steal too many colors required in images displayed later.
"/ In this case, it is better to preallocate some colors, and dither all images
"/ using theese. Of course, while making the worst case better, this makes
"/ the best case worse. You can decide ...
"/
"/   Color getColors6x6x4.


"/ claus:
"/     The history manager automatically adds a history line to changed
"/     methods and optionally to a classes history method.
"/     if you dont like this, comment the following lines.
"/
thisIsExeptsDomain ifTrue:[
    HistoryManager notNil ifTrue:[
	'private.rc [info]: activating HistoryManager ...' infoPrintCR.
	HistoryManager activate.
    ]
].

"/ claus:
"/     I startup the rdoit server process;
"/     (using rdoit to start ST/X views via window manager menus ...)
"/     If you like (and want) this to be also started automatically,
"/     replace the if- by 'true ifTrue:...' or remove the if.
"/
"
thisIsMySystem ifTrue:[
    'private.rc [info]: starting RDoItServer ...' infoPrintCR.
    Autoload autoloadFailedSignal handle:[:ex |
	'private.rc [warning]: cannot load RDoItServer' errorPrintCR
	ex return
    ] do:[
	RDoItServer autoload.
	RDoItServer start.
	RDoItServer allowHost:'localhost'.
    ]
].
"

"/ claus:
"/     I dont want those warnings about stx features being non-portable ...
"/     However, you should (at least when new to the system) see them.
"/     Once you get bored about them, make the below unconditional.
"/     (you can also turn them off in the Launchers settings menu ...)
"/
Compiler warnPossibleIncompatibilities:false.
Compiler warnSTXSpecials:false.
Compiler allowUnderscoreInIdentifier:true.
Compiler warnUnderscoreInIdentifier:false.


"/ set the package back to some useful default for programming
"/ this is the package token assigned (by default) to all new methods/classes
"/ (so you can use a browser on package=#private to find all of your new
"/ stuff easily. (the conditional on Project being nonNil is for stripped down
"/ systems without a Project class)

Project notNil ifTrue:[
    Project setDefaultProject.
    "/ Project current package:#'private'.
].
!

"/
"/ any personal file (p_<username>.rc) ?
"/
Smalltalk fileIn:('p_' , OperatingSystem getLoginName , '.rc').

(Smalltalk commandLine includes:'-q') ifFalse:[
    "/
    "/ this turns off/on information messages from classes
    "/ (such as 'D8IMAGE: allocating colors ...'
    "/
    "/ Object infoPrinting:false.
    OperatingSystem hasConsole ifTrue:[
	Object infoPrinting:true.
    ].

    "/
    "/ this turns off/on information messages from the VM
    "/ (such as 'MEM: chitty chatty ...'
    "/
    "/ ObjectMemory infoPrinting:false.
    OperatingSystem hasConsole ifTrue:[
	ObjectMemory infoPrinting:true.
    ]
].

"/
"/ startBlocks will be evaluated after the thread-scheduler have been started
"/ and the displays event dispatcher is running.
"/
Smalltalk addStartBlock:[
    "/ ca's private preferences...
    (OperatingSystem getLoginName = 'ca'
    and:[OperatingSystem getHostName = 'IDEFIX']) ifTrue:[
	'private.rc [info]: changing keyboard mapping...' infoPrintCR.
	Smalltalk fileIn:'d_win32_visualAge.rc'.
    ].

    "/
    "/ start some views ...
    "/ you can add all stuff you'd like to come up by default
    "/ the first time.
    "/

    'private.rc [info]: starting main-menu...' infoPrintCR.
    Text new. "/ to avoid visible messages in minitalk

    NewLauncher open.

    (Smalltalk commandLineArguments includes:'--quick') ifFalse:[
    	"/
    	"/ disable this if you don't like the other window to come up
    	"/
    	WorkspaceApplication openSystemWorkspace.
    ].

    "/
    "/ start a SystemBrowser
    "/ - I dont want one (using Launcher)
    "/
    "/ NewSystemBrowser open.

    "/
    "/ start a FileBrowser
    "/ - I dont want one (using Launcher)
    "/
    "/ FileBrowserV2 open.

    "/
    "/ start a Workspace
    "/ - I dont want one (using Launcher)
    "/
    "/ WorkspaceApplication open.
].

!