Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

As a work-around to an issue with ibus, I'm trying to unset the variable $IBUS_ENABLE_SYNC_MODE. I have tried placing "unset IBUS_ENABLE_SYNC_MODE" in various places including:

  • .profile
  • .bashrc
  • /etc/environment
  • as a startup application

However, none of this is reflected in applications launched in Unity; for example, when I launch a terminal from Unity the result is:

~$ echo $IBUS_ENABLE_SYNC_MODE
1

Where should I set this variable so that Unity sources it properly?

Edit: The reason why my attempts are not working was because IBUS_ENABLE_SYNC_MODE is set internally by Unity code on start-up. So, short of modifying and recompiling Unity by hand, this does not have a solution.

share|improve this question

3 Answers 3

The easy way to set personal environment variables for Unity (or any other X session) is to add them to the file $HOME/.xsessionrc. These variables are seen by everything launched in the session, via menus, GUIs, terminal windows, etc. For example, put this text in $HOME/.xsessionrc:

# File sourced by /etc/X11/Xsession, for setting environment variables, etc.
export FOOVAR=testing

Log out and back in, then from a shell window:

my-pc> echo $FOOVAR
testing

Tested under 12.04, using Unity. But this feature is implemented by the /etc/X11/Xsession script used by many types of desktop session, so it should work with any session type. See the Xsession man page.

share|improve this answer

Create a file in /etc/X11/Xsession.d/ for it, e.g. /etc/X11/Xsession.d/98local (it has to be executed before 99x11-common_start).

If this doesn't work try to find out where the variable gets set. Something like

sudo grep -r IBUS_ENABLE_SYNC_MODE /etc/

may help here to find the file.

share|improve this answer
    
Unfortunately, no luck. :\ –  Yubin Kim Nov 25 '11 at 3:59

I don't know what you are trying to do with this but usually every variable that needs to be "global" is set or unset in /etc/bash.bashrc so you have to edit this file.

share|improve this answer
    
I need the change to be not only visible in bash shells but also in every application launched, including Firefox, LibreOffice etc. This work around basically fixes an issue where a space character is committed before a Korean glyph, causing unfortunate spacing issues like 가나_다 instead of 가나다. –  Yubin Kim Nov 23 '11 at 18:47
    
in my experience bash.bashrc does this job correctly, basically it's a script invoked at every boot time by the OS so it's probably what are you looking for; if i set something in this file, after the reboot is available to the entire system. –  Micro Nov 23 '11 at 18:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.