From 4dd0a5a4f5964fc39e6d5a3ae4fc1540d3b175f4 Mon Sep 17 00:00:00 2001 From: alexion Date: Sun, 11 Oct 2026 17:49:05 -0400 Subject: [PATCH] feat(rofi): increase launcher contrast --- .../nixos/modules/desktop/session/rofi.nix | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/configs/nixos/modules/desktop/session/rofi.nix b/configs/nixos/modules/desktop/session/rofi.nix index 8339db4..ab4f787 100644 --- a/configs/nixos/modules/desktop/session/rofi.nix +++ b/configs/nixos/modules/desktop/session/rofi.nix @@ -6,19 +6,17 @@ }: # rofi as the desktop launcher and dmenu-style menu frontend. let - user = config.user.name; - # A session menu built on the same themed rofi, so the power actions look # like every other menu the launcher drives. powerMenu = pkgs.writeShellScript "rofi-power-menu" '' chosen=$(printf '%s\n' Lock Suspend 'Log out' Reboot 'Shut down' \ - | ${pkgs.rofi}/bin/rofi -dmenu -i -p Power) + | ${lib.getExe pkgs.rofi} -dmenu -i -p Power) case "$chosen" in - Lock) ${pkgs.systemd}/bin/loginctl lock-session ;; - Suspend) ${pkgs.systemd}/bin/systemctl suspend ;; - 'Log out') ${pkgs.systemd}/bin/loginctl terminate-session "$XDG_SESSION_ID" ;; - Reboot) ${pkgs.systemd}/bin/systemctl reboot ;; - 'Shut down') ${pkgs.systemd}/bin/systemctl poweroff ;; + Lock) ${lib.getExe' pkgs.systemd "loginctl"} lock-session ;; + Suspend) ${lib.getExe' pkgs.systemd "systemctl"} suspend ;; + 'Log out') ${lib.getExe' pkgs.systemd "loginctl"} terminate-session "$XDG_SESSION_ID" ;; + Reboot) ${lib.getExe' pkgs.systemd "systemctl"} reboot ;; + 'Shut down') ${lib.getExe' pkgs.systemd "systemctl"} poweroff ;; esac ''; in @@ -26,12 +24,34 @@ in options.modules.desktop.session.rofi.enable = lib.mkEnableOption "the rofi launcher"; config = lib.mkIf config.modules.desktop.session.rofi.enable { + home-manager.users.${config.user.name} = hm: { + # Stylix supplies the Nord theme. + programs.rofi = { + enable = true; + font = lib.mkForce "JetBrains Mono 12"; + + # Application launch is the only mode, kept minimal so the prompt opens + # as fast as rofi can read the desktop entries. + # Icons are off: resolving one per entry is the bulk of drun's startup. + extraConfig = { + modi = "drun"; + show-icons = false; + }; + + theme.window = { + border = hm.config.lib.formats.rasi.mkLiteral "2px"; + border-color = hm.config.lib.formats.rasi.mkLiteral "#FFFFFF"; + border-radius = hm.config.lib.formats.rasi.mkLiteral "8px"; + }; + }; + }; + registry.keybind.${config.networking.hostName} = { rofi-launcher = { keys = "SUPER + R"; action = { kind = "exec"; - command = "${pkgs.rofi}/bin/rofi -show drun"; + command = "${lib.getExe pkgs.rofi} -show drun"; }; }; @@ -43,21 +63,5 @@ in }; }; }; - - home-manager.users.${user} = { - # No theme is set here: Stylix's rofi target supplies the Nord one. - programs.rofi = { - enable = true; - - # Application launch is the only mode, kept minimal so the prompt opens - # as fast as rofi can read the desktop entries. - # Icons are off: resolving one per entry is the bulk of drun's startup. - extraConfig = { - modi = "drun"; - show-icons = false; - }; - }; - - }; }; } -- 2.47.3