Nixpkgs: ibus does not work with any toolkit

Created on 1 Oct 2016  路  21Comments  路  Source: NixOS/nixpkgs

Description

ibus does not work with GTK 2, GTK 3, or Qt 5.

Reproduce

I have the following in configuration.nix:

  i18n.inputMethod = {
    enabled = "ibus";
    ibus.engines = with pkgs.ibus-engines; [ table table-others ];
  };

The ibus icon appears in my system tray and I can use the keyboard shortcut to select input methods, but they do not have any effect in any application.

Details

  • System: NixOS 16.09.git.6c34d85 (Flounder)
  • Nix version: nix-env (Nix) 1.12pre4523_3b81b26

    Related

17277 #11558

Attn. @ericsagnes

bug regression

All 21 comments

I tested the ibus 1.5.14 with i3 today with a few engines and it was working fine.

There is an issue with ibus and gnome 3 (#17277), but I am not familiar enough with gnome to be helpful on that one (as far as I can tell, gnome 3 putting a vanilla ibus in environment sounds wrong).

What was the desktop environment(s) this problem happened? Also what version of ibus is affected, 1.5.13 or 1.5.14 only?

This is ibus 1.5.13 under KDE 5. The desktop environment shouldn't make a difference, though, if all the environment variables are set correctly. In my case, they seem to be:

GTK_IM_MODULE=ibus
QT_IM_MODULE=ibus
XMODIFIERS='@im=ibus'

Is there something missing?

FWIW I have it working okay for both Qt, GTK2 and X11 apps on XFCE with a similar configuration (different engines).

EDIT: I realized that such a comment is not particularly helpful -- sorry!

FWIW I have it working okay for both Qt, GTK2 and X11 apps on XFCE with a similar configuration (different engines).

@abbradar Which engines are you using? It could be the engines that are broken here.

@ttuegel Just uniemoji. It works for me properly after I select it via a hotkey.

@ttuegel What are the engines you are using?
Doing some tests now, will give report ASAP.

@ericsagnes Just table and table-others. Specifically, the LaTeX input method.

i3

configuration.nix

{ config, pkgs, ... }:


{
  imports =
    [
      <nixos/modules/installer/scan/not-detected.nix>
    ];
  nix.maxJobs = 4;

  nix.useSandbox = true;

  nixpkgs.config.allowUnfree = true;

  environment.systemPackages = with pkgs; [
    # gtk 2
    geany
    # gtk 3
    gnome3.gedit
    # kde 4
    kde4.kate
    # kde 5 + pyqt5
    qutebrowser
    tree
  ];

  users.extraUsers.alice = {
    createHome = true;
    home = "/home/alice";
    description = "Alice";
    extraGroups = [ "wheel" ];
    isSystemUser = false;
    useDefaultShell = true;
    password = "alice";
  };

  hardware.enableAllFirmware = true;

  sound.enable = false;

  # Select internationalisation properties.
  i18n = {
    consoleFont = "lat9w-16";
    consoleKeyMap = "jp106";
    defaultLocale = "en_US.UTF-8";
  };

  i18n.inputMethod = {
    enabled = "ibus";
    ibus.engines = with pkgs.ibus-engines; [ anthy hangul ];
  };

  services.xserver = {
    enable = true;
    layout = "jp";
    videoDrivers = ["intel"];

    desktopManager.default = "none";
    desktopManager.xterm.enable = false;
    displayManager.slim.enable = true;
    windowManager.default = "i3";
    windowManager.i3.enable = true;
  };

  time.timeZone = "Asia/Tokyo";

}

command:

nixos-rebuild build-vm -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/6c34d85.tar.gz -I nixos-config=/tmp/ibus.nix

result:

i3

OK, I'm trying to rebuild with anthy now.

kde5

configuration.nix

same as previous, except xserver block

  services.xserver = {
    enable = true;
    layout = "jp";
    videoDrivers = ["intel"];

    desktopManager.default = "none";
    desktopManager.xterm.enable = false;
    displayManager.slim.enable = true;
    desktopManager.kde5.enable = true;
  };

command:

# nixos-rebuild build-vm -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/6c34d85.tar.gz -I nixos-config=/tmp/ibus.nix
# ./result/bin/run-nixos-vm -m 4000

result:

kde5

@ericsagnes It looks like this is definitely a problem with the table-based engines, then?

I will give a try with table and table others.
I have no experience with these ones, what should I try to input to reproduce your problem?

A simple test is, with the LaTeX input method, \alpha \beta \gamma should give you lowercase Greek characters.

Figured almost the same test :)
But it seems to work fine here. (using the same settings for the previous i3, only changed the engines)

i3-latex

Does trying the configuration in vm or with a new user also fails? (just guessing that something in the environment might be causing trouble)

It does work in a VM, so something is wrong in my environment. Also, I noticed that in my broken environment, trying to switch input methods doesn't actually work. (The tray icon never changes.) I also notice there are lots of /nix/store paths in $HOME/.cache/ibus/bus/registry and many errors logged in $HOME/.cache/ibus-table/debug.log. What do you recommend?

I just noticed that direct Unicode input works with ibus, so it's definitely a problem with the table methods.

Deleting $HOME/.cache/ibus-table fixed the problem, even though there didn't seem to be anything actually cached there! It was just logs... Should we update the ibus-daemon wrapper to delete that cache at startup? It doesn't hold any configuration data. Actually, it doesn't seem to hold anything at all.

I had similar problems and everything was solved after deleting .cache/ibus, then I've found flag for ibus-daemon which seemed to deal with this problem -- it was something like --refresh, though you better recheck (I'm away from my nixos right now).

The current command to start ibus already include --cache=refresh, could it be that an ibus-daemon process is already present so the command gets ignored?

In that case, adding --replace to the autostart command to force the restart of the daemon might help.

I think it's better to add --cache=refresh to a wrapper around ibus-daemon. Some environments don't even call things from XDG autostart and prefer running ibus-daemon directly (desktop manager-less custom sessions). This way we would consistently clean cache in any possible usecase.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ob7 picture ob7  路  3Comments

retrry picture retrry  路  3Comments

edolstra picture edolstra  路  3Comments

rzetterberg picture rzetterberg  路  3Comments

tomberek picture tomberek  路  3Comments