[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Rxvt question



On Tue, Jun 29, 1999 at 02:00:19PM -0400, Brian Mays wrote:
|>>>>> "Anthony" == Anthony Wong <hajime@asunaro.dhs.org> writes:
|    Anthony> p.s. Is it better to check the user's current locale
|    Anthony> settings when he/she types 'crxvt'? If the locale is
|    Anthony> zh_TW.Big5, then starts rxvt-big5, if it is zh_CN.GB2312,
|    Anthony> then starts rxvt-gb.
|
|This is an interesting idea.  If you think that it would be useful, then
|perhaps crxvt should be a wrapper script that tests the locale (how
|should that be done?) and executes the appropriate binary.  Something
|like the following:
|
|----------------------------------------
|#!/bin/sh
|
|if [ <locale = zh_CN.GB2312> ]; then
|	exec /usr/X11R6/bin/crxvt-gb
|else
|	exec /usr/X11R6/bin/crxvt-big5
|fi
|----------------------------------------

How about this wrapper script? Maybe mine is not the best, please
comment if you have any improvements.

----------------------------------------
#!/bin/sh

RXVT_BIG5=/usr/X11R6/bin/rxvt-big5
RXVT_GB=/usr/X11R6/bin/rxvt-gb
DEFAULT_RXVT=$RXVT_BIG5
#DEFAULT_RXVT=$RXVT_GB
ARGS="-im xcin -pt Root"
    
if [ x$LC_ALL = xzh_TW.Big5 ]; then
    $RXVT_BIG5 $ARGS
elif [ x$LC_ALL = xzh_CN.GB2312 ]; then
    $RXVT_GB $ARGS
elif [ x$LC_CTYPE = xzh_TW.Big5 ]; then
    $RXVT_BIG5 $ARGS
elif [ x$LC_CTYPE = xzh_CN.GB2312 ]; then
    $RXVT_GB $ARGS
elif [ x$LANG = xzh_TW.Big5 ]; then
    $RXVT_BIG5 $ARGS
elif [ x$LANG = xzh_CN.GB2312 ]; then
    $RXVT_GB $ARGS
else
    $DEFAULT_RXVT $ARGS
fi
----------------------------------------

-- 
Anthony Wong.   [ E-mail: hajime@asunaro.dhs.org / ypwong@debian.org ]


Reply to: