Mailing List Archive


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

Re: [tlug] Japanese Input on CentOS / KDE



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Aug 12, 2005 at 10:58:56AM +0900, Dave Gutteridge wrote:
> Scott,
>     I followed your instructions as faithfully as I could. At first, I did not 
> have kterm installed, so I had to hunt for an RPM. I got it though, and we're 
> all good. At first I thought it was weird that the killall command found no 
> process, when I had just seen a process with kinput2 in it. Then I realized 
> that all that had been returned was a process to do with my search for kinput2, 
> not an actual kinput2 process actually running.

Yes, the trick is something like 
ps -ax | grep kinput2 |grep -v grep 

As you're new to Linux, a quick (and useful) lesson--grep -v means find
something that IS NOT included.  This way, you avoid getting the PID for
grep.


>     Anyway, here's how it went:
> 
> [root@example.com dave]# which kterm
> /usr/X11R6/bin/kterm
> [root@example.com dave]# ps ax | grep kinput2
>  4196 pts/4    S+     0:00 grep kinput2
> [root@example.com dave]# killall kinput2
> kinput2: no process killed
> [root@example.com dave]# kinput2 -canna &
> [1] 4198
> [root@example.com dave]# XMODIFIERS='@example.com=kinput2' LC_CTYPE=ja_JP.eucjp kterm
> 
> >Assuming we get that far, then please hit shift space and see if you get
> >hiragana.  
> And I do!
> I should point out something that is a small detail, but it threw me, and it 
> could easily throw other newbies reading your new and improved web site.
> 
> When I first got into vi, I hit shift+space, and nothing happened. So my first 
> impression was that we had not been successful in getting Japanese input.
> 
> But, to make a long story of experimentation short, what I discovered is that 
> the very first time I press shift+space, I have to either hold it down for a 
> second or two, or I have to rifle on the space key while holding down the shift 
> key. In other words, it seems to take a moment or two to actually kick-start 
> the Japanese input process. Maybe that's a loading from memory issue, or maybe 
> my computer kind of sucks. In any case, it's a bit of a curve ball that might 
> need mention, as it means one could potentially do everything right, and still 
> not think they've got it set up.

Hrrm, interesting.  Are you familiar with vi?  That is, I suspect this
might have been something with the mode--often, folks new to vi don't
realize they are in, or not in, insert mode. 

I boot up in text mode (which is quicker, by the way) and start an X
session with startx.  I'm not sure how one would have a program run at
start of KDE if you boot in graphically, but I'm sure it's relatively
trivial.  (I don't use KDE). 

The next trick is to have kinput running when you start KDE.  Hrrm, now
that I think of it, I think I figured it out in Mepis for a howto.  I'll
have to find that post.

Ok, we've gotten that far.  We want kinput2 up and running when you
start kde. 
Next, you'll make a script.

#!/bin/sh
XMODIFIERS='@example.com=kinput2' LC_CTYPE=ja_JP.eucjp ${1+"$@"} &

You will save that script as lang.sh.  You can put it anywhere in your
$PATH.  If you're not familiar with the $PATH variable, just put it in
/usr/local/bin.  Make it executable.

chmod 755 /usr/local/bin/lang.sh

Now, whenever you want to start an application you can use the command
line and do something like 

lang.sh firefox
lang.sh kterm

As for open office, I'm not sure what the command is in RedHat.  In
FreeBSD, for example, with openoffice-2.x it's
/usr/local/bin/openoffice, in ArchLInux it's
/opt/openoffice2/program/soffice.  You'll have to figure that out on
your system, then call that with the lang.sh script as well.  This
shoudl enable kanji in openoffice.
> 

> But, the good news is that we have Japanese input, at least in vi, and if I set 
> the environment before calling a kterm. I'm assuming (hoping?) there's a way to 
> get this so that it's a global setting where I can have this available to all 
> programs automatically, and not have to launch every application with this 
> "XMODIFIERS..." stuff.

Ah, if you want all programs to have it, there has to be a place when
you start KDE.  Much easier to do with a text login, though I assume
that's because I'm unfamiliar with KDE. 

Let me see if I can find that post on mepislovers.  Hold on....

Ah here it is.
 At least in Mepis, there is a directory in your $HOME directory called
.kde.  Note the dot in front, it's a hidden file.  In there, there might
be a directory called Autostart.  If not, create it

mkdir Autostart

cd Autostart

Create a file called whatever, or you can call it lang1.sh

#!/bin/sh
XMODIFIERS='@example.com=kinput2' LC_CTYPE=ja_JP.eucjp
kinput2 -canna &

Make it executable

chmod 755 lang1.sh

Now, I think all these things will be set whenever you start KDE.


- -- 

Scott Robbins

PGP keyID EB3467D6
( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 )
gpg --keyserver pgp.mit.edu --recv-keys EB3467D6

Buffy: You're missing the whole point of Halloween.
Willow: Free candy?!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQFC/Afn+lTVdes0Z9YRAph5AKCc8tUrmpkM2FqmfYEz8kwmjWiZOACglKbI
hqnpfQjW/TTnpeRlmDWnk40=
=WXpD
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links