¡¡¡¡ÕâÁ½ÖÖ·½Ê½µÄXWindowÆô¶¯¹ý³ÌÓÐûÓÐÇø±ðÄØ£¿Èç¹ûÄãûÓÐ×ö¹ý¸öÐÔ»¯ÉèÖÿÉÄÜÌå»á²»µ½£¬µ«Èç¹ûÄãÉèÖùýÖÐÎÄÊäÈë·¨£¬²»¹ÜÊÇÓÃSCIM»¹ÊÇfcitx£¬¿ÉÄܶ¼ÓйýÉèÖÃÊäÈë·¨ÎªËæXWindowÆô¶¯µÄ¾Ñé¡£
¡¡¡¡ÅóÓÑÃÇ¿ªÊ¼Ð޸ĸ÷ÖÖÆô¶¯½Å±¾£¬¾³£¿ÉÄÜ»áÐ޸ĵ½µÄ·½·¨ÓУº
¡¡¡¡1¡¢ÐÞ¸Ä/etc/X11/xinit/xinitrc
¡¡¡¡2¡¢ÐÞ¸Ä/etc/X11/Xsession
¡¡¡¡3¡¢ÔÚ/etc/X11/Xsession.dĿ¼ÏÂÔö¼ÓÒ»¸ö×Ô¶¨ÒåµÄ½Å±¾
¡¡¡¡4¡¢ÐÞ¸Ä$HOME/.xsession
¡¡¡¡5¡¢ÐÞ¸Ä$HOME/.xinitrc
¡¡¡¡6¡¢ÐÞ¸Ä/etc/X11/xdm/Xsession
¡¡¡¡¡¡
¡¡¡¡×ÜÖ®£¬¿´ÆðÀ´ÊǰËÏɹýº£¸÷Óи÷µÄÉñͨÁË¡£ÕâЩ·½·¨ÓÐûÓв»Í¬£¿ÎªÊ²Ã´ÓÐʱºòÃ÷Ã÷ÉèÖúÃÁË£¬startxÆðÀ´¿ÉÒÔÓÃÁË£¬µ«ÖØÆôÔÚXWindow¹ÜÀí½çÃæµÇ¼ºóÈ´²»ÄÜÓÃÁË£¿ÎªÊ²Ã´ÓÐʱ´ÓXWindow¹ÜÀí½çÃæµÇ¼ºó¿ÉÓ㬵«startxºóÈ´Óò»ÁË£¿
¡¡¡¡ÏÂÃæÎÒÃÇÒ»ÆðÀ´·ÖÎöһϰɡ£
ÒýÓÃ:#!/bin/sh
#
# /etc/X11/Xsession
#
# global Xsession file -- used by display managers and xinit (startx)
# $Id: Xsession 2186 2005-02-11 07:11:05Z branden $
set -e
PROGNAME=Xsession
message () {
# pretty-print messages of arbitrary length; use xmessage if it
# is available and $DISPLAY is set
MESSAGE="$PROGNAME: $*"
echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2
if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
fi
}
message_nonl () {
# pretty-print messages of arbitrary length (no trailing newline); use
# xmessage if it is available and $DISPLAY is set
MESSAGE="$PROGNAME: $*"
echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2;
if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
fi
}
errormsg () {
# exit script with error
message "$*"
exit 1
}
internal_errormsg () {
# exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
# One big call to message() for the sake of xmessage; if we had two then
# the user would have dismissed the error we want reported before seeing the
# request to report it.
errormsg "$*" \
"Please report the installed version of the \"xfree86-common\"" \
"package and the complete text of this error message to" \
"<debian-x@lists.debian.org>."
}
# initialize variables for use by all session scripts
OPTIONFILE=/etc/X11/Xsession.options
SYSRESOURCES=/etc/X11/Xresources
USRRESOURCES=$HOME/.Xresources
SYSSESSIONDIR=/etc/X11/Xsession.d
USERXSESSION=$HOME/.xsession
ALTUSERXSESSION=$HOME/.Xsession
ERRFILE=$HOME/.xsession-errors
# attempt to create an error file; abort if we cannot
if touch "$ERRFILE" 2> /dev/null && [ -w "$ERRFILE" ] &&
[ ! -L "$ERRFILE" ]; then
chmod 600 "$ERRFILE"
elif ERRFILE=$(tempfile 2> /dev/null); then
if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
message "warning: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
"\"$ERRFILE\"; look for session log/errors in" \
"\"$TMPDIR/xsession-$USER\"."
fi
else
errormsg "unable to create X session log/error file; aborting."
fi
exec >>"$ERRFILE" 2>&1
echo "$PROGNAME: X session started for $LOGNAME at $(date)"
# sanity check; is our session script directory present?
if [ ! -d "$SYSSESSIONDIR" ]; then
errormsg "no \"$SYSSESSIONDIR\" directory found; aborting."
fi
# Attempt to create a file of non-zero length in /tmp; a full filesystem can
# cause mysterious X session failures. We do not use touch, :, or test -w
# because they won't actually create a file with contents. We also let standard
# error from tempfile and echo go to the error file to aid the user in
# determining what went wrong.
WRITE_TEST=$(tempfile)
if ! echo "*" >>"$WRITE_TEST"; then
message "warning: unable to write to ${WRITE_TEST%/*}; X session may exit" \
"with an error"
fi
rm -f "$WRITE_TEST"
# Use run-parts to source every file in the session directory; we source
# instead of executing so that the variables and functions defined above
# are available to the scripts, and so that they can pass variables to each
# other.
SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)
if [ -n "$SESSIONFILES" ]; then
for SESSIONFILE in $SESSIONFILES; do
. $SESSIONFILE
done
fi
exit 0
¡¡¡¡´ËÎļþµÄµÚÎåÐС°# global Xsession file -- used by display managers and xinit (startx)¡±ÒѾ˵Ã÷/etc/X11/Xsession½Å±¾ÊÇ´ó¼Ò¹«Óõģ¬ÎÞÂÛÄãÊÇÓÃXWindow¹ÜÀíÆ÷£¨±ÈÈçkdm¡¢gdm¡¢xdm£©½øÈ뻹ÊÇͨ¹ýÃüÁîÐÐÊäÈëstartx£¨¼´xinit·½Ê½£©½øÈëXWindow£¬¶¼»áµ÷Óô˽ű¾³ÌÐò¡£ÔÙ¿´¿´Õâ¸ö½Å±¾³ÌÐò×öÁËЩʲô°É¡£ÕâÒ»ÐС°SYSSESSIONDIR=/etc/X11/Xsession.d¡±¶¨ÒåÁËÒ»¸ö±äÁ¿Ö¸ÏòÁËĿ¼/etc/X11/Xsession.d£¬ºóÃæÓÖ³öÏÖÒ»¶Î´úÂ룺
ÒýÓÃ:SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)
if [ -n "$SESSIONFILES" ]; then
for SESSIONFILE in $SESSIONFILES; do
. $SESSIONFILE
done
fi
¡¡¡¡ÏÔÈ»ÕâÀïÊÇËÑË÷ÁËĿ¼/etc/X11/Xsession.dÀïÃæËùÓеĽű¾²¢Ò»Ò»Ö´ÐÐÍê±Ï¡£
¡¡¡¡Í¬Ê±Çë×¢ÒâÓÐÕâôÁ½ÐУº
ÒýÓÃ:USERXSESSION=$HOME/.xsession
ALTUSERXSESSION=$HOME/.Xsession
¡¡¡¡ÔÚÕâÀﲢûÓп´µ½Ê¹ÓÃÕâÁ½¸ö±äÁ¿£¬ÄÇôÔÚÕâ¸ö½Å±¾ÀﶨÒåÀ´×öʲô£¿ÏÂÃæÔÙ¿´Ò»Ï½ű¾/etc/X11/Xsession.d/50xfree86-common_determine-startupÀïµÄÄÚÈÝ£¬ÔÎÄÈçÏ£º
ÒýÓÃ:# $Id: 50xfree86-common_determine-startup 1437 2004-05-23 03:18:32Z branden $
# This file is sourced by Xsession(5), not executed.
# If no X session startup program was passed to the Xsession script as an
# argument (e.g., by the display manager), or if that program was not
# executable, fall back to looking for a user's custom X session script, if
# allowed by the options file.
if [ -z "$STARTUP" ]; then
if grep -qs ^allow-user-xsession "$OPTIONFILE"; then
for STARTUPFILE in "$USERXSESSION" "$ALTUSERXSESSION"; do
if [ -e "$STARTUPFILE" ]; then
if [ -x "$STARTUPFILE" ]; then
STARTUP="$STARTUPFILE"
else
STARTUP="sh $STARTUPFILE"
fi
break
fi
done
fi
fi
# If there is still nothing to use for a startup program, try the system
# default session manager, window manager, and terminal emulator.
if [ -z "$STARTUP" ]; then
if [ -x /usr/bin/x-session-manager ]; then
STARTUP=x-session-manager
elif [ -x /usr/bin/x-window-manager ]; then
STARTUP=x-window-manager
elif [ -x /usr/bin/x-terminal-emulator ]; then
STARTUP=x-terminal-emulator
fi
fi
# If we still have not found a startup program, give up.
if [ -z "$STARTUP" ]; then
ERRMSG="unable to start X session ---"
if grep -qs ^allow-user-xsession "$OPTIONFILE"; then
ERRMSG="$ERRMSG no \"$USERXSESSION\" file, no \"$ALTUSERXSESSION\" file,"
fi
errormsg "$ERRMSG no session managers, no window managers, and no terminal" \
"emulators found; aborting."
fi
# vim:set ai et sts=2 sw=2 tw=80:
ÕâÒ»ÐС°# This file is sourced by Xsession(5), not executed.¡±Ö¤Ã÷½Å±¾ÊDZ»Ö®Ç°µÄ
/etc/X11/Xsessionµ÷Óõ쬶øºóÃæÕâÒ»¶Î£º
for STARTUPFILE in "$USERXSESSION" "$ALTUSERXSESSION"; do
if [ -e "$STARTUPFILE" ]; then
if [ -x "$STARTUPFILE" ]; then
STARTUP="$STARTUPFILE"
else
STARTUP="sh $STARTUPFILE"
fi
break
fi
done
¡¡¡¡¸üÖ¤Ã÷ÁËÕâÒ»µã¡£ÔÚÕâÀï½Å±¾ËÑË÷Óû§Ä¿Â¼$HOMEϵÄ.xsession»ò.Xsession½Å±¾À´Ö´ÐС£
¡¡¡¡£¨ÔÚ/etc/X11/Xsession.dĿ¼Ï»¹ÓÐһЩ½Å±¾£¬ÕâÀï¾Í²»ÔÙ·ÖÎöÁË£¬¸÷λÓÐÐËȤ¿ÉÒÔ×Ô¼º¿´¿´£©
¡¡¡¡ÁíÍâÀ´¿´¿´/etc/X11/xinit/xinitrcÕâ¸ö½Å±¾£¬ÆäÔÎÄÄÚÈÝÈçÏ£º
ÒýÓÃ:##!/bin/sh
## $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $
#
## /etc/X11/xinit/xinitrc
##
## global xinitrc file, used by all X sessions started by xinit (startx)
#
## invoke global X session script
. /etc/X11/Xsession
¡¡¡¡×¢ÒâÕâÒ»¾ä¡°## global xinitrc file, used by all X sessions started by xinit (startx)¡±£¬Õâ˵Ã÷Õâ¸ö½Å±¾Ö»±»xinitµ÷Ó㨼´Óû§ÊäÈëstartxʱ£©¡£¶øÆäÖ´ÐеÄ×îºó»¹ÊÇÖ´ÐÐÁË/etc/X11/Xsession½Å±¾¡£¶øÓû§Èç¹ûÓÃÆäËüXWindow¹ÜÀí½çÃæµÇ¼ϵͳʱÕâ¸ö½Å±¾ÀïµÄÄÚÈÝÊDz»»á±»Ö´Ðеġ£×îºóÔÙÀ´¿´¿´/etc/X11/xdm/XsessionÕâ¸ö½Å±¾°É£¬ÆäÔÎÄÄÚÈÝÈçÏ£º
ÒýÓÃ:#!/bin/sh
#
# $Xorg: Xsession,v 1.4 2000/08/17 19:54:17 cpqbld Exp $
#
#
#
#
# $XFree86: xc/programs/xdm/config/Xsession,v 1.3 2001/01/17 23:45:24 dawes Exp $
# invoke global X session script
. /etc/X11/Xsession
¡¡¡¡´ÓÄÚÈÝÀ´¿´£¬Ò²ÊÇ×îÖÕÖ´ÐÐÁË/etc/X11/Xsession¡£
¡¡¡¡ÔÙ¿´¿´/etc/X11ÀïÃæµÄĿ¼½á¹¹£º
ÒýÓÃ:X Xsession.d cursors gdm rstart xinit
XF86Config-4 Xsession.options default-display-manager lbxproxy sysconfig xkb
Xresources Xwrapper.config fonts proxymngr twm xserver
Xsession app-defaults fs rgb.txt xdm xsm
¡¡¡¡ÏÔÈ»£¬ÕâÀï°ÑxinitºÍxdm¡¢twm¼°gdmÊÇ·Ö¿ªµÄ£¬ÔÚxinitÀïÖ´ÐеĽű¾ÊDz»»á±»xdmÀïµÄ½Å±¾µ÷Óõġ£´ÓÉÏÃæ¶Ô´úÂëµÄ·ÖÎö£¬´ó¼Ò¿ÉÒÔ¿´µ½£ºÆäʵXWindowÖ´ÐеĹؼü½Å±¾ÊÇ/etc/X11/Xsession£¬Õâ¸ö½Å±¾»áÈ¥ /etc/X11/Xsession.dĿ¼ÀïËÑË÷½Å±¾Ö´ÐУ¬Ò²»áÈ¥$HOME/ÏÂËÑË÷½Å±¾ÔËÐУ¬¶øÆäËüĿ¼xinit¡¢xdmµÈÀïÃæµÄ½Å±¾¶¼»áÈ¥µ÷Óà /etc/X11/XsessionÕâ¸ö½Å±¾¡£
¡¡¡¡ËùÒÔ£¬Èç¹ûÄãÏë°ÑÖÐÎÄÊäÈë·¨fcitx¡¢SCIMµÈÉèÖóÉËæXwindowÆô¶¯£¬±ÈÈçÒª¼ÓÈëÈçϽű¾£º
ÒýÓÃ:export LC_CTYPE=zh_CN.GBK
export XMODIFIERS="@im=fcitx"
export XIM=fcitx
export XIM_PROGRAM=fcitx
fcitx
¡¡¡¡ÄÇô¿ÉÒÔÓÃÈçϼ¸ÖÖ·½·¨£º
¡¡¡¡1¡¢¼Óµ½/etc/X11/Xsession¡£ÕâÖÖ·½·¨¶ÔËùÓÐÆô¶¯·½·¨¶¼¹ÜÀí¡£
¡¡¡¡2¡¢ÔÚ/etc/X11/Xsession.dĿ¼Àï×Ô¼ºÐ´Ò»¸ö½Å±¾£¬ÕâÖÖ·½·¨Ò²¶ÔËùÓÐÆô¶¯·½·¨¶¼¹ÜÀí¡£
¡¡¡¡3¡¢ÔÚ$HOMEĿ¼ÏÂÉú³É.xsession»ò.Xsession½Å±¾£¬ÕâÖÖ·½·¨Ò²¶Ôµ±Ç°µÇ¼Óû§ÓÐЧ¡£
¡¡¡¡4¡¢¼Óµ½/etc/X11/xinit/xinitrc½Å±¾Àï¡£Õâ¸ö·½·¨Ö»¶Ôxinit·½Ê½£¨¼´ÃüÁîÐÐÊäÈëstartx£©¹ÜÓá£
¡¡¡¡5¡¢¼Óµ½/etc/X11/xdm/xsession½Å±¾Àֻ¶ÔÓÃxdm¹ÜÀí½çÃæµÇ¼µÄ·½Ê½¹ÜÓá£
¡¡¡¡ÁíÍ⣬¹ØÓÚÈçºÎÉèÖÃÖÐÎÄÊäÈë·¨£¬Çë²Î¿´ÎÒµÄÎÄÕ¡¶LinuxÖÐÖÐÎÄÊäÈë·¨ËæXWindowÆô¶¯µÄÎÊÌâ¡·£¬»¹ÓÐÉèÖÃÖÐÎÄ×ÖÌåµÄÓ¦Ó㬿ÉÒԲμûÎÒµÄÎÄÕ¡¶ÔÚLinuxÀïʹÓÃWindowsµÄTrueType×ÖÌå¡·¡£
¡¡¡¡´ó¼Òϰ¹ßÁËÔÚLinuxÏÂÉú»îÁËÂð£¿ÊÇ·ñÓöµ½¹ýÌý¸èûÉùÒôµÄÇé¿ö£¿¿´¿´¡¶LinuxÏÂ/dev/dspÉ豸ÎļþµÄ×÷Óá·°É¡£


multitude ÓÚ 2006-12-14 00:44:58·¢±í:
Ö§³ÖϹØÓÚlinuxµÄºÃÎÄÕÂ
¸Ðл¥Ö÷