diff --git a/home/modules/linux/graphical/wayland.nix b/home/modules/linux/graphical/wayland.nix index c113db0..42fe7e5 100644 --- a/home/modules/linux/graphical/wayland.nix +++ b/home/modules/linux/graphical/wayland.nix @@ -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; diff --git a/home/modules/programs/my-niri.nix b/home/modules/programs/my-niri.nix index 1457bc6..42c59a9 100644 --- a/home/modules/programs/my-niri.nix +++ b/home/modules/programs/my-niri.nix @@ -18,6 +18,14 @@ let xwayland-display = ":0"; + # Override for lack of per-keyboard layout + ydotool-en = pkgs.writeScriptBin "ydotool" '' + #!/usr/bin/env sh + niri msg action switch-layout 1 && fcitx5-remote -c # us + ${lib.getExe pkgs.ydotool} "$@" + niri msg action switch-layout 0 # ja + ''; + in { options.programs.my-niri = { @@ -77,6 +85,7 @@ in }; config = lib.mkIf cfg.enable { + home.packages = [ ydotool-en ]; programs.my-niri.workspaces = { # Default workspaces, always there "01" = { @@ -158,7 +167,7 @@ in XDG_MENU_PREFIX = "plasma-"; }; input.keyboard.xkb = { - layout = "jp"; + layout = "jp,us"; }; input.touchpad = lib.mkIf cfg.enableLaptop { tap = true; diff --git a/modules/common/linux/default.nix b/modules/common/linux/default.nix index 927cef8..1060d03 100644 --- a/modules/common/linux/default.nix +++ b/modules/common/linux/default.nix @@ -79,6 +79,10 @@ let programs.niri.package = pkgs.niri-stable; # Override gnome-keyring disabling services.gnome.gnome-keyring.enable = lib.mkForce false; + # ydotool + programs.ydotool.enable = true; + users.extraGroups.${config.programs.ydotool.group}.members = [ cfg.username ]; + }; logitech =