On Tue, Oct 25, 2005 at 08:17:29PM +0900, Kenshi Muto wrote:
> At Mon, 24 Oct 2005 09:59:25 -0500,
> Ming Hua wrote:
> > As a workaround, I would at least like to see im-switch honor some
> > environment variable, like $DISABLE_IM_SWITCH or something, and if it's
> > set, don't do these "unset XMODIFIERS etc., and source im-switch
> > configurations" thing - i.e., put the whole thing in a "if [
> > $DISABLE_IM_SWITCH != 1 ] ... fi".
> > 
> > Does that sound like a sane solution?  Of course, it would be best to
> > implement a way to turn off im-switch, like /etc/default/im-switch or
> > similar, and has a debconf question to control it.
> 
> Well, I have an another idea.. just respecting user's configuration.
> How about following patch?

This is definitely much simpler than what I proposed, as long as it
doesn't break in the situations you unset those variables for (maybe
there aren't such situations, as the comment indicates, it may be just
"to be safe" :-).

> Index: xinput.sh
> ===================================================================
> --- xinput.sh (revision 26)
> +++ xinput.sh (working copy)
> @@ -18,7 +18,13 @@
>  ## try to source ~/.xinput.d/ll_CC or /etc/X11/xinit/xinput.d/ll_CC to
>  ## setup the input method for locale (CC is needed for Chinese for example)
>  # unset env vars to be safe
> -unset XIM XIM_PROGRAM XIM_ARGS XMODIFIERS GTK_IM_MODULE
> +_XIM=$XIM
> +_XIM_PROGRAM=$XIM_PROGRAM
> +_XIM_ARGS=$XIM_ARGS
> +_XMODIFIERS=$XMODIFIERS
> +_GTK_IM_MODULE=$GTK_IM_MODULE
> +_QT_IM_MODULE=$QT_IM_MODULE
> +
>  lang_region=$(echo $tmplang | sed -e 's/\..*//')
>  for f in $HOME/.xinput.d/${lang_region} \
>           $HOME/.xinput.d/default \
> @@ -28,6 +34,13 @@
>  done
>  unset lang_region

I am not a shell expert, so I don't really know what this "unset
lang_region" is for.  However if this is necessary, shouldn't $_XIM and
friends be unset at the end as well?

> +[ "$_XIM" ] && XIM=$_XIM
> +[ "$_XIM_PROGRAM" ] && XIM_PROGRAM=$_XIM_PROGRAM
> +[ "$_XIM_ARGS" ] && XIM_ARGS=$_XIM_ARGS
> +[ "$_XMODIFIERS" ] && XMODIFIERS=$_XMODIFIERS
> +[ "$_GTK_IM_MODULE" ] && GTK_IM_MODULE=$_GTK_IM_MODULE
> +[ "$_QT_IM_MODULE" ] && QT_IM_MODULE=$_QT_IM_MODULE
> +
>  [ -n "$GTK_IM_MODULE" ] && export GTK_IM_MODULE
>  [ -n "$QT_IM_MODULE" ] && export QT_IM_MODULE

Ming
2005.10.25


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to