#!/usr/local/bin/wish -f
# jprefs - stand-alone application to set global preferences

catch {tk colormodel . color}		;# colour even on a 2-bit display

global VERSION
set VERSION {3.6/2.0}

######################################################################

global NAME			;# user's login name
global HOME			;# user's home directory

global PREFS			;# user preferences

global env

set NAME $env(USER)
set HOME $env(HOME)

# check for $HOME/.tk/jlibrary.tcl and read it in if it exists.
# this contains library procedures.  it would normally be in $tk_library,
# but we check for its presence here for people who can't put things in
# $tk_library.
#
if {[file isfile "$HOME/.tk/jlibrary.tcl"]} then {
  source "$HOME/.tk/jlibrary.tcl"
}
# now check for some other library files which might be there (again,
# these would normally be in $tk_library):
j:source_config jrichtext.tcl
j:source_config jabout.tcl
j:source_config jbindings.tcl

wm withdraw .
j:read_standard_prefs
switch -exact $PREFS(bindings) {
  emacs {
    j:eb:emacs_bind Entry
  }
  basic {
    j:eb:basic_bind Entry
  }
}
j:global_pref_panel
exit 0
