FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-05-2009, 03:35 PM
Aneurin Price
 
Default A question about /etc/profile (was: Scim does not work with openoffice)

On Thu, Feb 5, 2009 at 4:18 PM, Rodolfo Medina <rodolfo.medina@gmail.com> wrote:
> Lisi Reisz <lisi.reisz@gmail.com> writes:
>
>> I added the following lines to /etc/profile:
>>
>> export XMODIFIERS=@im=SCIM
>> export GTK_IM_MODULE=scim
>> export QT_IM_MODULE=scim
>
>
> How can I get the same result *without* putting that stuff in /etc/profile? I
> mean, if I put that in /etc/profile, those commands are run at every boot,
> wheraes I want to run them at my pleasure. If I simply give them from command
> line:
>
> # export XMODIFIERS=@im=SCIM
> # export GTK_IM_MODULE=scim
> # export QT_IM_MODULE=scim
>
> they don't seem to take any effect.
>

What is it you're actually trying to do? Those environment variables should be
set for the shell you typed that into, and any child processes. They won't be
set globally because, as far as I know, there's no way to set the environment
for a parent process. This means that if you're opening up an xterm or whatever
and entering those variables then they will take effect for anything started
from that xterm, but not for anything else. To have them set across the board
you would need them set earlier - like in /etc/profile as you've discovered, or
your user's config files.

Nye


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-05-2009, 04:58 PM
Aneurin Price
 
Default A question about /etc/profile (was: Scim does not work with openoffice)

On Thu, Feb 5, 2009 at 6:37 PM, Rodolfo Medina <rodolfo.medina@gmail.com> wrote:
> Lisi Reisz <lisi.reisz@gmail.com> writes:
>
>>>> I added the following lines to /etc/profile:
>>>>
>>>> export XMODIFIERS=@im=SCIM
>>>> export GTK_IM_MODULE=scim
>>>> export QT_IM_MODULE=scim
>
>
> Rodolfo Medina wrote:
>
>>> How can I get the same result *without* putting that stuff in /etc/profile?
>>> I mean, if I put that in /etc/profile, those commands are run at every boot,
>>> wheraes I want to run them at my pleasure. If I simply give them from
>>> command line:
>>>
>>> # export XMODIFIERS=@im=SCIM
>>> # export GTK_IM_MODULE=scim
>>> # export QT_IM_MODULE=scim
>>>
>>> they don't seem to take any effect.
>
>
> Aneurin Price <aneurin.price@gmail.com> writes:
>
>
>> What is it you're actually trying to do? Those environment variables should
>> be set for the shell you typed that into, and any child processes. They won't
>> be set globally because, as far as I know, there's no way to set the
>> environment for a parent process. This means that if you're opening up an
>> xterm or whatever and entering those variables then they will take effect for
>> anything started from that xterm, but not for anything else. To have them set
>> across the board you would need them set earlier - like in /etc/profile as
>> you've discovered, or your user's config files.
>
>
> All right, that answers my question, thanks. Now, I put those lines in a
> script:
>
> #!/bin/bash
> export XMODIFIERS=@im=SCIM
> export GTK_IM_MODULE=scim
> export QT_IM_MODULE=scim
>
> , made it executable with `chmod 755' but it doesn't seem to work. Why?
>

Let's say you've saved this as 'script', and you're running '$./script' or
'$bash script'. What that will do is spawn a new bash process which interprets
the script, and then exits. If you want the variables to be set in the shell you
started from, rather than starting a new bash process, you shouldn't run the
script but instead 'source' it, like '$source script'. This tells the existing
shell to interpret the commands in the script, rather than creating a new shell
to do it.

Does that answer your question?

Nye


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-05-2009, 05:46 PM
Aneurin Price
 
Default A question about /etc/profile (was: Scim does not work with openoffice)

On Thu, Feb 5, 2009 at 7:35 PM, Rodolfo Medina <rodolfo.medina@gmail.com> wrote:
> Aneurin Price <aneurin.price@gmail.com> writes:
>
>> Let's say you've saved this as 'script', and you're running '$./script' or
>> '$bash script'. What that will do is spawn a new bash process which
>> interprets the script, and then exits. If you want the variables to be set in
>> the shell you started from, rather than starting a new bash process, you
>> shouldn't run the script but instead 'source' it, like '$source script'. This
>> tells the existing shell to interpret the commands in the script, rather than
>> creating a new shell to do it.
>
>
> $ source script
>
> has the same effect than running those three commands from command line.
> Instead, putting them in /etc/profile is more powerful, it gets more effects.
> It seems there's no alternative to that?
>

I'm not sure what you mean by 'more effects'. You can get the effect of
/etc/profile on a per user basis by adding commands to ~/.bash_profile (for bash
shells), ~/.profile (for most shells), ~/.xsession for X sessions - I *think*
this should be read by xdm/kdm/gdm and therefore work with any desktop
environment, but I'm not exactly sure how it's handled.
The one thing you can't do (so far as I know) is set variables for your whole
session *after* logging in.

Nye


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-05-2009, 10:16 PM
Aneurin Price
 
Default A question about /etc/profile (was: Scim does not work with openoffice)

On Thu, Feb 5, 2009 at 8:19 PM, Rodolfo Medina <rodolfo.medina@gmail.com> wrote:
> Lisi Reisz <lisi.reisz@gmail.com> writes:
>
>>> >>>>> I added the following lines to /etc/profile:
>>> >>>>>
>>> >>>>> export XMODIFIERS=@im=SCIM
>>> >>>>> export GTK_IM_MODULE=scim
>>> >>>>> export QT_IM_MODULE=scim
>
>
>
> Rodolfo Medina wrote:
>
>>> $ source script
>>>
>>> has the same effect than running those three commands from command line.
>>> Instead, putting them in /etc/profile is more powerful, it gets more
>>> effects. It seems there's no alternative to that?
>
>
>
> Lisi Reisz <lisi.reisz@gmail.com> writes:
>
>> The place I got that from said that you could put them in a user's own
>> profile file if you wanted them to be for one user only. I haven't tested
>> that, and I can't remember the details.
>>
>> I'm not clear why you object to putting it in /etc/profiles? I shan't be
>> using it myself very often - but I just wanted it to work, and by the
>> simplest (for me) method.
>
>
>
> Aneurin Price <aneurin.price@gmail.com> writes:
>
>> I'm not sure what you mean by 'more effects'. You can get the effect of
>> /etc/profile on a per user basis by adding commands to ~/.bash_profile (for
>> bash shells), ~/.profile (for most shells), ~/.xsession for X sessions - I
>> *think* this should be read by xdm/kdm/gdm and therefore work with any
>> desktop environment, but I'm not exactly sure how it's handled. The one
>> thing you can't do (so far as I know) is set variables for your whole session
>> *after* logging in.
>
>
>
> We're talking about details, now the problem of scim working with oowriter
> seems to be solved.
>
> Anyway: putting those `export' commands in /etc/profile has the advantage that
> I can put chinese characters also in the command line, with `C-space'. The
> disadvantage is that scim is automatically started every time I start the
> Terminal application, even if I don't want to use scim. The Terminal is slowed
> down when starting.
>
> On the other hand, running those three commands from command line has the
> advantage that I start scim only when necessary; but then it seems that I lose
> the possibility of using scim to input characters in the shell.
>
> I don't know if it's clear...
>

I don't know anything about scim, or what terminal you're using, so I'm guessing
that it's a Gnome Terminal based on the fact that you've been talking about scim
with Gtk apps. I would imagine - and may be wrong - that the terminal uses the
environment variable to set its input method on start up, so in order to have
the ability to use those characters in the terminal, you would need to set those
variables in the parent process. One way of doing that is to put them in your
.xsessionrc (I said .xsession earlier, but I believe that was wrong). This
would, as you say, be equivalent for that user to putting them in /etc/profile,
so every Gtk application would use scim.

How are you starting your terminal? If you're using a menu entry, you could
create a duplicate entry, then edit the command from '/usr/bin/gnome-terminal' -
or whatever it is - to 'XMODIFIERS=@im=SCIM GTK_IM_MODULE=scim QT_IM_MODULE=scim
/usr/bin/gnome-terminal' and the environment variables would apply to that
terminal alone, allowing you to use Chinese characters there without using scim
everywhere. You could keep using the old menu entry when you don't need to write
in Chinese. Is that more like what you want?
(I hope that works. It should do if I've understood the situation.)

Thanks,
Nye


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 07:05 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org