Hacky hack to make rofi-rbw typing less insane

There is some unknown interaction between `wtype` and `fcitx5`
that prevents the keyboard from being usable after wtype exits,
until fcitx5 restarts. Therefore a workaround is to use `ydotool`
to type the secrets instead.

However `ydotool` assumes an ANSI layout, which we cannot specifically
set up with niri just yet. So instead we set up a hack, to temporarily
disable fcitx & set Niri layout to ANSI right before invoking ydotool,
and reverting once it's complete.
This commit is contained in:
Natsu Kagami 2025-04-04 13:47:12 +02:00
parent 3e905fbf8f
commit 1de42e1a89
Signed by: nki
GPG key ID: 55A032EB38B49ADB
3 changed files with 28 additions and 8 deletions

View file

@ -84,15 +84,22 @@ let
"${pkgs.kdePackages.plasma-workspace}/share/dbus-1/services/org.kde.plasma.Notifications.service";
};
rofi-rbw-script = pkgs.writeShellApplication {
rofi-rbw-script = pkgs.writeTextFile rec {
name = "rofi-rbw-script";
runtimeInputs = with pkgs; [
config.programs.rofi.package
wtype
text = ''
#!/usr/bin/env fish
set -a PATH ${
lib.concatMapStringsSep " " (p: "${lib.getBin p}/bin") [
config.programs.rofi.package
pkgs.ydotool
pkgs.rofi-rbw
]
}
rofi-rbw
];
text = "rofi-rbw";
meta.mainProgram = "rofi-rbw-script";
'';
executable = true;
destination = "/bin/${name}";
meta.mainProgram = name;
};
in
with lib;