From 82cefd68e056378cd58098e27216327495de1405 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Wed, 13 Nov 2024 11:41:20 +0100 Subject: [PATCH] Move rofi-rbw to common wayland --- home/modules/linux/graphical/wayland.nix | 17 +++++++++++++++++ home/modules/programs/my-sway/default.nix | 17 +++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/home/modules/linux/graphical/wayland.nix b/home/modules/linux/graphical/wayland.nix index a403195..3c6cbd9 100644 --- a/home/modules/linux/graphical/wayland.nix +++ b/home/modules/linux/graphical/wayland.nix @@ -61,6 +61,12 @@ let ''; xdg.dataFile."dbus-1/services/org.freedesktop.Notifications.service".source = "${pkgs.kdePackages.plasma-workspace}/share/dbus-1/services/org.kde.plasma.Notifications.service"; }; + + rofi-rbw-script = pkgs.writeShellApplication { + name = "rofi-rbw-script"; + runtimeInputs = with pkgs; [ rofi wtype rofi-rbw ]; + text = "rofi-rbw"; + }; in with lib; { @@ -69,6 +75,7 @@ with lib; # Additional packages home.packages = with pkgs; [ wl-clipboard # Clipboard management + rofi-rbw-script # Mimic the clipboard stuff in MacOS (pkgs.writeShellScriptBin "pbcopy" '' @@ -79,6 +86,16 @@ with lib; '') ]; + programs.rofi = { + enable = true; + package = pkgs.rofi-wayland; + cycle = true; + font = "monospace"; + terminal = "${lib.getExe config.programs.kitty.package}"; + theme = "Paper"; + plugins = with pkgs; [ rofi-bluetooth rofi-calc rofi-rbw rofi-power-menu ]; + }; + home.sessionVariables = { ANKI_WAYLAND = "1"; }; diff --git a/home/modules/programs/my-sway/default.nix b/home/modules/programs/my-sway/default.nix index d4536f9..a01b4c0 100644 --- a/home/modules/programs/my-sway/default.nix +++ b/home/modules/programs/my-sway/default.nix @@ -45,12 +45,6 @@ let ${pkgs.grim}/bin/grim -g (${pkgs.slurp}/bin/slurp) - | ${pkgs.swappy}/bin/swappy -f - ''; - rofi-rbw-script = pkgs.writeShellApplication { - name = "rofi-rbw-script"; - runtimeInputs = with pkgs; [ rofi wtype rofi-rbw ]; - text = "rofi-rbw"; - }; - ignored-devices = [ "Surface_Headphones" ]; playerctl = "${pkgs.playerctl}/bin/playerctl --ignore-player=${strings.concatStringsSep "," ignored-devices}"; @@ -223,7 +217,7 @@ in # Launcher "${mod}+space" = "exec rofi -show drun"; "${mod}+tab" = "exec ${./rofi-window.py}"; - "${mod}+shift+p" = "exec ${lib.getExe rofi-rbw-script}"; + "${mod}+shift+p" = "exec rofi-rbw-script"; } // { ## Splits "${mod}+v" = "split v"; @@ -781,14 +775,9 @@ in # For waybar font-awesome ]); + config.programs.rofi = mkIf cfg.enable { - enable = true; - package = pkgs.rofi-wayland; - cycle = true; - font = "monospace ${toString cfg.fontSize}"; - terminal = cfg.terminal; - theme = "Paper"; - plugins = with pkgs; [ rofi-bluetooth rofi-calc rofi-rbw rofi-power-menu ]; + font = lib.mkForce "monospace ${toString cfg.fontSize}"; }; }