Skip to content
Snippets Groups Projects
Commit c2055cc4 authored by Gunnar Hjalmarsson's avatar Gunnar Hjalmarsson
Browse files

Use im-config on Wayland without uninstalling IBus

Provide the option to use im-config on GNOME on Wayland for configuring
and launching non-IBus frameworks without uninstalling IBus.
parent 3754fd85
Branches
Tags
No related merge requests found
......@@ -7,7 +7,7 @@ VERSION = $(shell dpkg-parsechangelog --format dpkg|\
endif
FILES = \
70-im-config \
im-config_wayland.sh \
70im-config_launch \
im-config \
im-launch \
......
......@@ -7,13 +7,29 @@ IBUS_ENABLE_SYNC_MODE=0 /usr/bin/ibus-daemon --daemonize --xim
fi
if [ "$IM_CONFIG_PHASE" = 1 ]; then
# set variables for the plain XIM
is_gnome () {
local OLDIFS="$IFS" desktop retval=1
IFS=':'
for desktop in $XDG_CURRENT_DESKTOP; do
[ "$desktop" = 'GNOME' ] && { retval=0; break; }
done
IFS="$OLDIFS"
return "$retval"
}
XMODIFIERS=@im=ibus
# Let's assume all required modules are installed
GTK_IM_MODULE=ibus
QT4_IM_MODULE=ibus
QT_IM_MODULE=ibus
CLUTTER_IM_MODULE=ibus
# better skip certain variables if GNOME on Wayland
if is_gnome && [ "$XDG_SESSION_TYPE" = 'wayland' ]; then
:
else
GTK_IM_MODULE=ibus
QT4_IM_MODULE=ibus
CLUTTER_IM_MODULE=ibus
fi
fi
im-config for Debian Osamu Aoki <osamu@debian.org>
See the latest info at: https://wiki.debian.org/InputMethodBuster
For Gnome on wayland environment with ibus package installed, im-config
is automatically disabled. Gnome supports ibus internally. You still
need to enable each input engine via Gnome "Settings" -> "Region &
Languages" --> "Input Sources".
For Gnome on wayland environment without ibus package installed,
im-config is enabled to support non-ibus input method. If you install
only uim, it is supported as the system wide choice. The start up of
uim takes several seconds. So be patient.
For Gnome on wayland, fcitx and scim are not tested well with im-config.
You may need to disable im-config by setting it to `none`.
For other classical X system, im-config should still work.
In order to ensure im-config settings to be updated, you should restart
the session reboot the system. (Yes, you should be able to use
systemctl but it is prone for problems.)
......
......@@ -3,6 +3,7 @@ im-config (0.45-1) UNRELEASED; urgency=medium
* default/im-config:
- Fcitx not preferred for Chinese on GNOME
- cjkv default mode for some Ubuntu flavors
* Use im-config on Wayland without uninstalling IBus
-- Gunnar Hjalmarsson <gunnarhj@ubuntu.com> Mon, 18 May 2020 22:35:00 +0200
......
70-im-config usr/lib/systemd/user-environment-generators
im-config_wayland.sh etc/profile.d
70im-config_launch etc/X11/Xsession.d
data/* usr/share/im-config/data
default/im-config etc/default
......
#! /bin/sh
# /etc/profile.d/im-config_wayland.sh
#
# This sets the IM variables on Wayland.
if ! [ -e "/usr/bin/ibus-daemon" ]; then
test "$XDG_SESSION_TYPE" = 'wayland' || return
# don't do anything if im-config was removed but not purged
test -r /usr/share/im-config/xinputrc.common || return
if [ -r /etc/X11/Xsession.d/70im-config_launch ]; then
. /etc/X11/Xsession.d/70im-config_launch
# always export variables even for manual configuration.
env | grep -E '^(IM_CONFIG_PHASE|XMODIFIERS|GTK_IM_MODULE|QT_IM_MODULE|QT4_IM_MODULE|CLUTTER_IM_MODULE)='
fi
fi
[Desktop Entry]
Name=im-launch
Exec=sh -c 'if ! [ -e "/usr/bin/ibus-daemon" ] && [ "x$XDG_SESSION_TYPE" = "xwayland" ] ; then exec env IM_CONFIG_CHECK_ENV=1 im-launch true; fi'
Exec=sh -c 'if [ "x$XDG_SESSION_TYPE" = "xwayland" ] ; then exec env IM_CONFIG_CHECK_ENV=1 im-launch true; fi'
TryExec=im-launch
Type=Application
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment