Of course

. Take a look at the last part of this message. I'd like to tell a few things first, though.
I don't remember exactly all the steps I made... just googled a lot and read some interesting things here and there. I'm pretty sure, however, that I didn't use im-switch (I've never installed it), because I had the impression it wouldn't do very well what I wanted: using a Latin (Spanish, in fact) layout as my primary input method (both for Spanish and Galician), while being able to switch to Greek and Japanese im's (and maybe others). Possibly I was wrong about this at that time, but now I don't care because it works

(well, at least always worked, and is working right now, in all the gtk apps). Also, I do remember tweaking my ~/scim/* files.
As a side note (this issue is getting funnier and funnier), a couple of days ago, Japanese stopped working again in Tk apps... and what makes it even more interesting: now it fails in a completely different fashion. For instance, the Greek and Spanish input methods are happier than ever

, but while Japanese seems to work at first glance (i.e. you can switch input methods while the conversation window is focused, and you can see the embedded "preedit string" window), when it comes to insert the characters (Kanji and such) into the text, it puts only blanks (and Windows MSN users told me they see square characters when I tried to send them). Also, if I try and paste a Japanese string into the window (from another app), it inserts something like "\233\321\423\221\113" (well, this are not the correct numbers, but that's not the point). All of this worked flawlessly, say, last week. AND, AGAIN, I DON'T REMEMBER UPDATING ANY PACKAGES RELATED TO SCIM OR TCL/TK. dO_ob Funny, funny, damn funny X^D.
Well, as I said in a previous message, I'm sitting on an Ubuntu Feisty (7.04) system. So here you have some interesting files:
/etc/X11/Xsession.d/74custom-scim_startup (I created this one, so this vars are set up system-wide for X; maybe you'd prefer to use .xinitrc or whatever):
export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE="scim"
export XIM_PROGRAM="scim -d"
export QT_IM_MODULE="scim"
Somewhere in ~/.gnome2/session, I have:
(...)
18,RestartCommand=scim -d
(...)
Here, '18' is circumstantial. (If I'm right, this was not done by hand-editing, but using the "System | Preferences | Sessions" applet in the Gnome Ubuntu menu to create a new "start application" entry -- the command to put there, of course, is "scim -d").
~/.scim/global
/DefaultKeyboardLayout = Spanish
(...)
~/.scim/config
/DefaultIMEngineFactory/C = c6bebc27-6324-4b77-8ad4-6d41dcaf2e08
/DefaultIMEngineFactory/es_ES = c6bebc27-6324-4b77-8ad4-6d41dcaf2e08
/DefaultIMEngineFactory/gl_ES = c6bebc27-6324-4b77-8ad4-6d41dcaf2e08
/FrontEnd/ChangeFactoryGlobally = true
/FrontEnd/IMOpenedByDefault = true
/FrontEnd/OnTheSpot = true
/FrontEnd/SharedInputMethod = true
/FrontEnd/Socket/ConfigReadOnly = false
/FrontEnd/Socket/MaxClients = 512
/FrontEnd/X11/BrokenWchar = true
/FrontEnd/X11/Dynamic = true
/FrontEnd/X11/OnTheSpot = true
/FrontEnd/X11/ServerName = SCIM
/Hotkeys/FrontEnd/NextFactory = Hyper+Scroll_Lock
/Hotkeys/FrontEnd/Off =
/Hotkeys/FrontEnd/On =
/Hotkeys/FrontEnd/PreviousFactory = Shift+Hyper+Scroll_Lock
/Hotkeys/FrontEnd/ShowFactoryMenu = Alt+Hyper+Scroll_Lock
/Hotkeys/FrontEnd/Trigger = Zenkaku_Hankaku,Hangul,Control+Hyper+Scroll_Lock
/Hotkeys/FrontEnd/ValidKeyMask = Shift+Control+Alt+CapsLock+Meta+Super+Hyper
/Hotkeys/IMEngine/6e029d75-ef65-42a8-848e-332e63d70f9c = Control+Alt+Hyper+l
/Hotkeys/IMEngine/List = 6e029d75-ef65-42a8-848e-332e63d70f9c
(...)
/Panel/Gtk/Color/ActiveBackground = light sky blue
/Panel/Gtk/Color/ActiveText = black
/Panel/Gtk/Color/NormalBackground = #F7F3F7
/Panel/Gtk/Color/NormalText = black
/Panel/Gtk/DefaultSticked = false
/Panel/Gtk/Font = default
/Panel/Gtk/LookupTableEmbedded = true
/Panel/Gtk/LookupTableVertical = true
/Panel/Gtk/ShowStatusBox = false
/Panel/Gtk/ShowTrayIcon = true
/Panel/Gtk/ToolBar/AlwaysHidden = true
/Panel/Gtk/ToolBar/AlwaysShow = false
/Panel/Gtk/ToolBar/AutoSnap = true
/Panel/Gtk/ToolBar/HideTimeout = 2
/Panel/Gtk/ToolBar/POS_X = -1
/Panel/Gtk/ToolBar/POS_Y = -1
/Panel/Gtk/ToolBar/ShowFactoryIcon = true
/Panel/Gtk/ToolBar/ShowFactoryName = true
/Panel/Gtk/ToolBar/ShowHelpIcon = true
/Panel/Gtk/ToolBar/ShowMenuIcon = true
/Panel/Gtk/ToolBar/ShowPropertyLabel = true
/Panel/Gtk/ToolBar/ShowSetupIcon = true
/Panel/Gtk/ToolBar/ShowStickIcon = true
/UpdateTimeStamp = 1188953827:114437
Most of this was automatically created by scim the first time it was launched (launch it without -d switch from command line, then interrupt with Ctrl-C), but I think I tweaked some things around the first lines. I put here everything that can be of some interest, and wiped out the boring lines

. Not sure about what that "c6bebc27-6324-4b77-8ad4-6d41dcaf2e08" thing may mean, but it seems to me that it is some kind of reference to the Spanish keyboard layout.
Finally, my /etc/default/locale
LANG="gl_ES.UTF-8"
LANGUAGE="gl_ES:gl:es_ES:es:en_US:en_GB:en"
Finally, please note that I did some tests, changing "scim -d" to "scim -f X11 -d" everywhere, and back again.
If you need more information, don't hesitate to ask.
Faneca.