Ibus not working with electron apps

Hello.

I’ve been using ibus on gnome/wayland in nixos without any issue, until today.

It seems like ibus is not recognized by electron apps at all, as none of these method I’ve tried won’t work

  1. run electron based app with --enable-wayland-ime
  2. flatpak run --env=GTK_IM_MODULE=xim … as it stated workaround in flatpak issue #1671

Any possible issue / workaround for this ?

Here’s my configuration.nix for english/korean ibus btw.

+) I’ve checked ibus env is valid, here’s env for ibus of my nixos.

~/my-nixos main 40s
❯ echo $GTK_IM_MODULE
❯ echo $XMODIFIERS
❯ echo $QT_IM_MODULE
ibus
@im=ibus
ibus

Try also passing --wayland-text-input-version=3, I don’t believe gnome implements text_input_v1.

I’m afraid chainging text-input-version didn’t worked out. :frowning:
Tested on slack, youtube-music, vscode, ticktick.

Can you try with export NIXOS_OZONE_WL=1 and then running those apps while keeping the extra flags?

1 Like

Can you try --ozone-platform=wayland --enable-wayland-ime --wayland-text-input-version=3? Although it should work on xwayland, without any flags.

1 Like

Thx It worked, but I suspect this is the just the limitation of electrons on native wayland :frowning:

Unfortunately, native Wayland support doesn’t seem seamless, as mentioned in nixos issue #394395.

I’ll look into how to configure native Wayland options for Electron apps so that they work seamlessly.

~/my-nixos main ⇡
❯ code --ozone-platform=wayland --enable-wayland-ime --wayland-text-input-version=3
Warning: 'ozone-platform-hint' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'enable-features' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'enable-wayland-ime' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'wayland-text-input-version' is not in the list of known options, but still passed to Electron/Chromium.

Screencast From 2025-05-13 01-02-13

You can override vscode to keep those flags at all times:

(pkgs.vscode.override {
  commandLineArgs = "--ozone-platform=wayland --enable-wayland-ime --wayland-text-input-version=3";
})

See nixpkgs/pkgs/applications/editors/vscode/generic.nix at a39ed32a651fdee6842ec930761e31d1f242cb94 · NixOS/nixpkgs · GitHub for how they are applied.

For the other programs you’d have to check if they support such an arg, if not then you can use makeWrapper to add such flags in permanently.

2 Likes

At the moment, it seems like the only workaround is to overlay Chromium for each Electron module, – as you’ve suggested, much thx –
which might clutters the configuration and violates the DRY principle.

Hence I’d like to find a cleaner solution.

Unfortunately, it seems there’s no way to inject Electron flags without using overlays.
I tried placing a ~/.config/electron-flags.conf file (as suggested in the ArchWiki with:

--ozone-platform-hint=auto
--enable-wayland-ime
--wayland-text-input-version=3

But none of the Nix-packaged Electron apps pick up these flags.

Is there a specific reason why Electron on Nix would ignore the per-user electron-flags.conf?

Apologies on my immature understanding how nix works.
I’ve totally forgot how it work internally.

Nix builds packages from scratch,which is the binaries of application.
That being said, the electron-flags.conf I’d tried to apply globally was just foolish idea, since nix won’t work in that way.

I reckon this somehow verbose, since even it’s not chromium/electron, some packages might need to share same configuration globally, and it would be awesome that nix could do that.

So I’ll be looking into a way to share dotfiles or config in nix.
I’ll reply if I find a solid solution/workaround for it.
Thx

That is the behaviour of the archlinux package, not electron.

Yes, it is handled in each package currently, but there is an ongoing effort to do it in electron wrapper (and hopefully configurable): https://github.com/NixOS/nixpkgs/pull/389943


By the way, there’s a Nix discord server for Korean speakers: nixos.kr
Join in if you want!

2 Likes

@vanillacake369 Would you like to share the versions of programs that worked?

I can’t even get simple google-chrome-stable or chromium to work with ibus on wayland (hyprland), with or without the flags ( --ozone-platform=wayland --enable-wayland-ime --wayland-text-input-version=3).

But ibus works just fine on qutebrowser.

❯ google-chrome-stable --version
Google Chrome 136.0.7103.113 

❯ ibus version
IBus 1.5.31

❯ hyprctl version
Hyprland 0.49.0

Sure. Here’s how overlay I’ve configured and the version of currrent system.

( I’m using wayland / gnome btw. )

{
  description = "Custom basic linux configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    system-manager = {
      url = "github:numtide/system-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs, home-manager, system-manager, nixos-wsl, ... }:
    let
      lib = nixpkgs.lib;
      system = "x86_64-linux";
      pkgs = import nixpkgs { 
        inherit system;
        overlays = [(final: prev: {
          google-chrome = prev.google-chrome.override {
            commandLineArgs =
              "--ozone-platform-hint=auto --enable-wayland-ime --enable-features=TouchpadOverscrollHistoryNavigation --wayland-text-input-version=3";
          };
          vscode = prev.vscode.override {
            commandLineArgs =
               "--ozone-platform-hint=auto --enable-wayland-ime --enable-features=TouchpadOverscrollHistoryNavigation --wayland-text-input-version=3";
          };
          slack = pkgs.symlinkJoin {
            name = "slack";
            paths = [ prev.slack ];
            buildInputs = [ pkgs.makeWrapper ];
            postBuild = ''
              wrapProgram $out/bin/slack \
                --add-flags "--ozone-platform-hint=auto --enable-wayland-ime --enable-features=TouchpadOverscrollHistoryNavigation --wayland-text-input-version=3"
            '';
          };
        })];
        config.allowUnfree = true;
      };
    in {
      # Define nixos configuration
      nixosConfigurations = {
        nixos = nixpkgs.lib.nixosSystem {
          inherit system;
          inherit pkgs;
          modules = [
            ./configuration.nix
          ];
        };
      };
      # Define the home-manager configuration
      homeConfigurations = {
        hama = home-manager.lib.homeManagerConfiguration {
          inherit pkgs;
          modules = [ 
            ./home.nix
            ./limjihoon-user.nix 
          ];
        };     
        limjihoon = home-manager.lib.homeManagerConfiguration {
          inherit pkgs;
          modules = [ 
            ./home.nix
            ./limjihoon-user.nix 
          ];
        };        
        nixos = home-manager.lib.homeManagerConfiguration {
          inherit pkgs;
          modules = [ 
            ./home.nix
            ./nixos-user.nix 
          ];
        };
      };
      # Define system manager to cope with linux distro system
      systemConfigs.default = system-manager.lib.makeSystemConfig {
        modules = [
          ./modules
        ];
      };
    };
}
// wayland-info
interface: 'wl_compositor',                              version:  6, name:  1
interface: 'wl_drm',                                     version:  2, name:  2
interface: 'wl_shm',                                     version:  2, name:  3
	formats (fourcc):
	0x32315559 = 'YU12'
	0x30313050 = 'P010'
	0x3231564e = 'NV12'
	0x56595559 = 'YUYV'
	0x48344258 = 'XB4H'
	0x48344241 = 'AB4H'
	0x48345258 = 'XR4H'
	0x48345241 = 'AR4H'
	0x30334258 = 'XB30'
	0x30334241 = 'AB30'
	0x30335258 = 'XR30'
	0x30335241 = 'AR30'
	0x36314752 = 'RG16'
	0x34324258 = 'XB24'
	0x34324241 = 'AB24'
	         1 = 'XR24'
	         0 = 'AR24'
interface: 'wl_output',                                  version:  4, name:  4
	name: HDMI-1
	description: Samsung Electric Company 34"
	x: 0, y: 0, scale: 1,
	physical_width: 800 mm, physical_height: 330 mm,
	make: 'SAM', model: 'S34J55x',
	subpixel_orientation: unknown, output_transform: normal,
	mode:
		width: 3440 px, height: 1440 px, refresh: 49.986 Hz,
		flags: current preferred
interface: 'wl_output',                                  version:  4, name:  5
	name: eDP-1
	description: Built-in display
	x: 760, y: 1440, scale: 1,
	physical_width: 340 mm, physical_height: 190 mm,
	make: 'LGD', model: '0x05d4',
	subpixel_orientation: unknown, output_transform: normal,
	mode:
		width: 1920 px, height: 1080 px, refresh: 60.020 Hz,
		flags: current preferred
interface: 'zxdg_output_manager_v1',                     version:  3, name:  6
	xdg_output_v1
		output: 4
		name: 'HDMI-1'
		description: 'Samsung Electric Company 34"'
		logical_x: 0, logical_y: 0
		logical_width: 3440, logical_height: 1440
	xdg_output_v1
		output: 5
		name: 'eDP-1'
		description: 'Built-in display'
		logical_x: 760, logical_y: 1440
		logical_width: 1920, logical_height: 1080
interface: 'wl_data_device_manager',                     version:  3, name:  7
interface: 'xdg_toplevel_drag_manager_v1',               version:  1, name:  8
interface: 'zwp_primary_selection_device_manager_v1',    version:  1, name:  9
interface: 'wl_subcompositor',                           version:  1, name: 10
interface: 'xdg_wm_base',                                version:  6, name: 11
interface: 'gtk_shell1',                                 version:  6, name: 12
interface: 'wp_viewporter',                              version:  1, name: 13
interface: 'wp_fractional_scale_manager_v1',             version:  1, name: 14
interface: 'zwp_pointer_gestures_v1',                    version:  3, name: 15
interface: 'zwp_tablet_manager_v2',                      version:  1, name: 16
interface: 'wl_seat',                                    version:  8, name: 17
	name: seat0
	capabilities: pointer keyboard
	keyboard repeat rate: 33
	keyboard repeat delay: 500
interface: 'zwp_relative_pointer_manager_v1',            version:  1, name: 18
interface: 'zwp_pointer_constraints_v1',                 version:  1, name: 19
interface: 'zxdg_exporter_v2',                           version:  1, name: 20
interface: 'zxdg_importer_v2',                           version:  1, name: 21
interface: 'zxdg_exporter_v1',                           version:  1, name: 22
interface: 'zxdg_importer_v1',                           version:  1, name: 23
interface: 'zwp_linux_dmabuf_v1',                        version:  5, name: 24
	main device: 0xE280 (/dev/dri/card1 or /dev/dri/renderD128)
	tranche
		target device: 0xE280 (/dev/dri/card1 or /dev/dri/renderD128)
		flags: none
		formats (fourcc) and modifiers (names):
		0x48344241 = 'AB4H'; 0x0000000000000000 = LINEAR
		0x48344241 = 'AB4H'; 0x0100000000000001 = INTEL_X_TILED
		0x48344241 = 'AB4H'; 0x0100000000000002 = INTEL_Y_TILED
		0x48344241 = 'AB4H'; 0x0100000000000004 = INTEL_Y_TILED_CCS
		0x48344241 = 'AB4H'; 0x00ffffffffffffff = INVALID
		0x48344258 = 'XB4H'; 0x0000000000000000 = LINEAR
		0x48344258 = 'XB4H'; 0x0100000000000001 = INTEL_X_TILED
		0x48344258 = 'XB4H'; 0x0100000000000002 = INTEL_Y_TILED
		0x48344258 = 'XB4H'; 0x0100000000000004 = INTEL_Y_TILED_CCS
		0x48344258 = 'XB4H'; 0x00ffffffffffffff = INVALID
		0x30335241 = 'AR30'; 0x0000000000000000 = LINEAR
		0x30335241 = 'AR30'; 0x0100000000000001 = INTEL_X_TILED
		0x30335241 = 'AR30'; 0x0100000000000002 = INTEL_Y_TILED
		0x30335241 = 'AR30'; 0x00ffffffffffffff = INVALID
		0x30335258 = 'XR30'; 0x0000000000000000 = LINEAR
		0x30335258 = 'XR30'; 0x0100000000000001 = INTEL_X_TILED
		0x30335258 = 'XR30'; 0x0100000000000002 = INTEL_Y_TILED
		0x30335258 = 'XR30'; 0x00ffffffffffffff = INVALID
		0x30334241 = 'AB30'; 0x0000000000000000 = LINEAR
		0x30334241 = 'AB30'; 0x0100000000000001 = INTEL_X_TILED
		0x30334241 = 'AB30'; 0x0100000000000002 = INTEL_Y_TILED
		0x30334241 = 'AB30'; 0x00ffffffffffffff = INVALID
		0x34325241 = 'AR24'; 0x0000000000000000 = LINEAR
		0x34325241 = 'AR24'; 0x0100000000000001 = INTEL_X_TILED
		0x34325241 = 'AR24'; 0x0100000000000002 = INTEL_Y_TILED
		0x34325241 = 'AR24'; 0x0100000000000004 = INTEL_Y_TILED_CCS
		0x34325241 = 'AR24'; 0x00ffffffffffffff = INVALID
		0x34324241 = 'AB24'; 0x0000000000000000 = LINEAR
		0x34324241 = 'AB24'; 0x0100000000000001 = INTEL_X_TILED
		0x34324241 = 'AB24'; 0x0100000000000002 = INTEL_Y_TILED
		0x34324241 = 'AB24'; 0x0100000000000004 = INTEL_Y_TILED_CCS
		0x34324241 = 'AB24'; 0x00ffffffffffffff = INVALID
		0x34325258 = 'XR24'; 0x0000000000000000 = LINEAR
		0x34325258 = 'XR24'; 0x0100000000000001 = INTEL_X_TILED
		0x34325258 = 'XR24'; 0x0100000000000002 = INTEL_Y_TILED
		0x34325258 = 'XR24'; 0x0100000000000004 = INTEL_Y_TILED_CCS
		0x34325258 = 'XR24'; 0x00ffffffffffffff = INVALID
		0x34324258 = 'XB24'; 0x0000000000000000 = LINEAR
		0x34324258 = 'XB24'; 0x0100000000000001 = INTEL_X_TILED
		0x34324258 = 'XB24'; 0x0100000000000002 = INTEL_Y_TILED
		0x34324258 = 'XB24'; 0x0100000000000004 = INTEL_Y_TILED_CCS
		0x34324258 = 'XB24'; 0x00ffffffffffffff = INVALID
		0x36314752 = 'RG16'; 0x0000000000000000 = LINEAR
		0x36314752 = 'RG16'; 0x0100000000000001 = INTEL_X_TILED
		0x36314752 = 'RG16'; 0x0100000000000002 = INTEL_Y_TILED
		0x36314752 = 'RG16'; 0x00ffffffffffffff = INVALID
		0x32315559 = 'YU12'; 0x0000000000000000 = LINEAR
		0x32315559 = 'YU12'; 0x0100000000000001 = INTEL_X_TILED
		0x32315559 = 'YU12'; 0x0100000000000002 = INTEL_Y_TILED
		0x32315559 = 'YU12'; 0x00ffffffffffffff = INVALID
		0x3231564e = 'NV12'; 0x0000000000000000 = LINEAR
		0x3231564e = 'NV12'; 0x0100000000000001 = INTEL_X_TILED
		0x3231564e = 'NV12'; 0x0100000000000002 = INTEL_Y_TILED
		0x3231564e = 'NV12'; 0x00ffffffffffffff = INVALID
		0x30313050 = 'P010'; 0x0000000000000000 = LINEAR
		0x30313050 = 'P010'; 0x0100000000000001 = INTEL_X_TILED
		0x30313050 = 'P010'; 0x0100000000000002 = INTEL_Y_TILED
		0x30313050 = 'P010'; 0x00ffffffffffffff = INVALID
		0x56595559 = 'YUYV'; 0x0000000000000000 = LINEAR
		0x56595559 = 'YUYV'; 0x0100000000000001 = INTEL_X_TILED
		0x56595559 = 'YUYV'; 0x0100000000000002 = INTEL_Y_TILED
		0x56595559 = 'YUYV'; 0x00ffffffffffffff = INVALID
interface: 'wp_single_pixel_buffer_manager_v1',          version:  1, name: 25
interface: 'zwp_keyboard_shortcuts_inhibit_manager_v1',  version:  1, name: 26
interface: 'zwp_text_input_manager_v3',                  version:  1, name: 27
interface: 'wp_presentation',                            version:  2, name: 28
	presentation clock id: 1 (CLOCK_MONOTONIC)
interface: 'xdg_activation_v1',                          version:  1, name: 29
interface: 'zwp_idle_inhibit_manager_v1',                version:  1, name: 30
interface: 'wp_linux_drm_syncobj_manager_v1',            version:  1, name: 31
interface: 'xdg_wm_dialog_v1',                           version:  1, name: 32
interface: 'wp_color_manager_v1',                        version:  1, name: 33
interface: 'xdg_system_bell_v1',                         version:  1, name: 34
interface: 'wp_drm_lease_device_v1',                     version:  1, name: 35
	path: /dev/dri/card1
interface: 'wp_drm_lease_device_v1',                     version:  1, name: 36
	path: /dev/dri/card0
interface: 'wp_commit_timing_manager_v1',                version:  1, name: 37
interface: 'wp_fifo_manager_v1',                         version:  1, name: 38
interface: 'wp_cursor_shape_manager_v1',                 version:  2, name: 39
1 Like