Hi,

Simplest one line to check 
$ pidof scim-launcher|xargs -n1 ps --no-headers -o user,pid --pid 
2>/dev/null|grep "^${USER}  *"|awk '{print $2}'
4513
4504

Or ... much simpler

$ pidof scim-launcher|xargs -n1 ps --no-headers -o user,pid --pid 
2>/dev/null|sed -n "s/^${USER}  *\([1-9][0-9]*\)$/\1/p"


Thus the scim start up code 
if [ -z "$(pidof scim-launcher|xargs -n1 ps --no-headers -o user,pid --pid 
2>/dev/null|sed -n "s/^${USER}  *\([1-9][0-9]*\)$/\1/p")" ] ; then scim -d >& 
/dev/null ; fi

The only problem is xargs is in /usr/bin which makes this less robust
but since this is for X, I think /usr is there :-)

As I see for SCIM:

XIM_PROGRAM=/usr/bin/scim
XIM_ARGS="-d"

With these, the following is actually executed
# execute XIM_PROGRAM
[ -n "$XIM_PROGRAM" -a -x "$XIM_PROGRAM" ] && eval "$XIM_PROGRAM $XIM_ARGS &" ||
 true

Changing SCIM setting to something like
XIM_PROGRAM="if [ -z \"$(pidof scim-launcher|xargs -n1 ps --no-headers -o 
user,pid --pid 2>/dev/null|sed -n \"s/^${USER}  *\([1-9][0-9]*\)$/\1/p\")\" ] ; 
then /usr/bin/scim -d >& /dev/null ; fi"
XIM=ARGS=""

Maybe, I need to reassign this to SCIM.  I will test it :-)

Osamu




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

Reply via email to