From 13bea63f5da885361d7b3491c3fd71b07ac77d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 31 Jul 2025 16:14:49 +0200 Subject: [PATCH] feat(niri): switch back to rofi --- flake.nix | 9 +++---- modules/moritz/profiles/impermanence.nix | 4 ++++ modules/moritz/programs/niri.nix | 30 ++++++++++++++++++------ 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 9574d9a..12afb59 100644 --- a/flake.nix +++ b/flake.nix @@ -151,13 +151,16 @@ flake-compat.url = "github:edolstra/flake-compat"; niri.url = "github:sodiboo/niri-flake"; systems.url = "github:nix-systems/default"; - stylix.url = "github:nix-community/stylix/79e816c2e63df5024e28292fee0d92dc106ff66c"; # HACK: to fix upstream issue + stylix.url = "github:nix-community/stylix"; base16-helix.url = "github:MoritzBoehme/base16-helix/fix-primary-cursor-color"; base16-helix.flake = false; # Programs timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git"; filetags.url = "git+https://gitea.moritzboeh.me/moritz/filetags.git"; + rofi-nix.url = "git+https://git.sr.ht/~fgaz/rofi-nix"; + rofi.url = "github:davatorium/rofi/next"; + rofi.flake = false; # Neovim neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; @@ -205,11 +208,9 @@ nixvim.inputs.systems.follows = "systems"; nur.inputs.flake-parts.follows = "flake-parts"; nur.inputs.nixpkgs.follows = "nixpkgs"; + rofi-nix.inputs.nixpkgs.follows = "nixpkgs"; stylix.inputs.base16-helix.follows = "base16-helix"; - stylix.inputs.flake-compat.follows = "flake-compat"; stylix.inputs.flake-parts.follows = "flake-parts"; - stylix.inputs.git-hooks.follows = "git-hooks"; - stylix.inputs.home-manager.follows = "home-manager"; stylix.inputs.nixpkgs.follows = "nixpkgs"; stylix.inputs.nur.follows = "nur"; stylix.inputs.systems.follows = "systems"; diff --git a/modules/moritz/profiles/impermanence.nix b/modules/moritz/profiles/impermanence.nix index c03c969..e723a40 100644 --- a/modules/moritz/profiles/impermanence.nix +++ b/modules/moritz/profiles/impermanence.nix @@ -38,6 +38,10 @@ in { directories = [ ".cache/keepassxc" ".cat_installer" # eduroam + ".cache/rofi-4.runcache" # FIXME: move to own file + ".cache/rofi-nix" + ".cache/rofi-entry-history.txt" + ".cache/rofi3.druncache" ".config/Nextcloud" ".config/Signal/" ".config/calibre" diff --git a/modules/moritz/programs/niri.nix b/modules/moritz/programs/niri.nix index 1691133..529ed06 100644 --- a/modules/moritz/programs/niri.nix +++ b/modules/moritz/programs/niri.nix @@ -29,6 +29,9 @@ in { wl-clipboard # clipboard tool for wayland wlr-randr jq + + inputs.rofi-nix.packages.${pkgs.system}.default + rofi-bluetooth ]; # adds pam module for swaylock @@ -38,10 +41,7 @@ in { programs.niri.package = cfg.package; my = { - programs = { - wallpaper.enable = true; - tofi.enable = true; - }; + programs.wallpaper.enable = true; wallpapers.enable = true; services = { wallpaper = { @@ -52,7 +52,14 @@ in { }; }; home-manager.users.moritz = { - programs.fuzzel.enable = true; + programs.rofi = { + enable = true; + package = pkgs.rofi-wayland.override { + plugins = [ + pkgs.rofi-calc + ]; + }; + }; programs.waybar = { enable = true; @@ -121,12 +128,15 @@ in { environment = { "NIXOS_OZONE_WL" = "1"; "QT_QPA_PLATFORM" = "wayland"; + "TERMINAL" = config.my.terminal.package; # HACK: to fix desktop entries with terminal=true to open in preferred terminal }; binds = { # spawn different programs "Mod+Return".action.spawn = config.my.terminal.package; "Mod+Shift+escape".action.spawn = ["loginctl" "lock-session"]; - "Mod+R".action.spawn = "fuzzel"; + "Mod+R".action.spawn = ["rofi" "-show" "combi" "-modes" "drun,run,nix:rofi-nix,combi" "-combi-modes" "drun,run,nix"]; + "Mod+Shift+C".action.spawn = ["rofi" "-show" "calc" "-modi" "calc" "-no-show-match" "-no-sort"]; + "Mod+B".action.spawn = "rofi-bluetooth"; # keyboard layout "Mod+Space".action = actions.switch-layout "next"; @@ -134,7 +144,7 @@ in { "Mod+I".action = actions.show-hotkey-overlay; "Mod+Q".action = actions.close-window; "Mod+Shift+Q".action = actions.quit; - "Mod+Shift+C".action = actions.screenshot; + "Mod+Shift+S".action = actions.screenshot; # resizing / swapping / switching "Mod+F".action = actions.fullscreen-window; @@ -231,6 +241,12 @@ in { top-right = 5.0; }; } + { + matches = [ + {title = "^.*rofi.*$";} + ]; + open-floating = true; + } ]; switch-events = { lid-close.action.spawn = ["loginctl" "lock-session"];