ibus/setup-switch-im.patch
Fuminobu Takeyama 192fafe9e1 Accepting request 998856 from home:ftake:branches:M17N
- Fix ibus-setup to support python3 (boo#1202063)
  * Update setup-switch-im.patch
- Remove X-GNOME-* from ibus-autostart.desktop
  (boo#1201421, boo#1201728)
  * ibus-autostart still does not work with
    systemd-xdg-autostart-generator

OBS-URL: https://build.opensuse.org/request/show/998856
OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=267
2022-08-23 14:27:26 +00:00

66 lines
2.7 KiB
Diff

--- ibus-1.5.26/setup/main.py.org 2022-03-14 14:15:48.000000000 +0900
+++ ibus-1.5.26/setup/main.py 2022-08-21 23:04:59.698814168 +0900
@@ -508,11 +508,16 @@
self.__engine_setup_exec_list[name] = os.spawnl(os.P_NOWAIT, *args)
def __init_bus(self):
+ method_name="ibus"
+ filename=".i18n"
+ usr_home =os.path.expanduser('~')
+
self.__bus = IBus.Bus()
if self.__bus.is_connected():
return
- message = _("The IBus daemon is not running. Do you wish to start it?")
+ message = _("Could not connect to IBus daemon.\n"
+ "Do you wish to switch to IBus on next login?")
dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.QUESTION,
buttons = Gtk.ButtonsType.YES_NO,
text = message)
@@ -522,39 +527,11 @@
if id != Gtk.ResponseType.YES:
sys.exit(0)
- main_loop = GLib.MainLoop()
-
- timeout = 5
- GLib.timeout_add_seconds(timeout, lambda *args: main_loop.quit())
- self.__bus.connect("connected", lambda *args: main_loop.quit())
-
- os.spawnlp(os.P_NOWAIT, "ibus-daemon", "ibus-daemon", "--xim", "--daemonize")
-
- main_loop.run()
-
- if self.__bus.is_connected():
- message = _("IBus has been started! "
- "If you cannot use IBus, add the following lines to your $HOME/.bashrc; then relog into your desktop.\n"
- " export GTK_IM_MODULE=ibus\n"
- " export XMODIFIERS=@im=ibus\n"
- " export QT_IM_MODULE=ibus"
- )
- dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.INFO,
- buttons = Gtk.ButtonsType.OK,
- text = message)
- id = dlg.run()
- dlg.destroy()
- self.__flush_gtk_events()
- else:
- # Translators: %d == 5 currently
- message = _("IBus daemon could not be started in %d seconds.")
- dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.INFO,
- buttons = Gtk.ButtonsType.OK,
- text = message % timeout)
- id = dlg.run()
- dlg.destroy()
- self.__flush_gtk_events()
- sys.exit(0)
+ filename = os.path.join(usr_home, filename)
+ with open(filename, "w+") as f:
+ cmd = 'export INPUT_METHOD=\"' + method_name + '\"'
+ f.writelines(cmd)
+ sys.exit(0)
def __shortcut_button_clicked_cb(self, button, name, section, _name, entry):
buttons = (_("_Cancel"), Gtk.ResponseType.CANCEL,