how can I write a simple program, lets say scimcontrol, that does the following two things?
$ scimcontrol --show-method
outputs the name of the scim input method for the active X window.
$ scimcontrol --change-method Anthy
changes the scim input method to Japanese/Anthy
This program makes it possible for vim scripts to provide automatic scim input method switching for vim.