3

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.

3 Answers 3

8

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.

1

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.

1
  • Unfortunately, no luck. :\
    – Yubin Kim
    Nov 25, 2011 at 3:59
-1

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.

3
  • 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, 2011 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, 2011 at 18:58
  • Not everybody uses bash.
    – kzh
    Dec 21, 2015 at 10:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .