From 678eeccac59c907b5d4edd831f5e0ef80b538973 Mon Sep 17 00:00:00 2001 From: ediblerope Date: Thu, 14 May 2026 10:15:56 +0100 Subject: [PATCH] --- settings/hyprland.nix | 112 ++++++++++++++++++++++++++++-------------- 1 file changed, 74 insertions(+), 38 deletions(-) diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 5efee53..1ad34a7 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -118,7 +118,7 @@ in "$mod" = "SUPER"; "$term" = "ghostty"; - "$menu" = "rofi -show drun"; + "$menu" = "killall anyrun || anyrun"; exec-once = [ "mako" @@ -222,8 +222,21 @@ in "$mod, J, movefocus, d" # L freed for hyprlock — arrow keys still handle right-focus. - # Lock screen - "$mod, L, exec, hyprlock" + # Power menu (contains lock option) + "$mod, L, exec, ${pkgs.writeShellScript "power-menu" '' + choice=$(printf "Lock\nLogout\nReboot\nShutdown" \ + | ${pkgs.anyrun}/bin/anyrun \ + --plugins "${pkgs.anyrun}/lib/libstdin.so" \ + --show-results-immediately true \ + --hide-plugin-info true \ + --close-on-click true) + case "$choice" in + *Lock) ${pkgs.hyprlock}/bin/hyprlock ;; + *Logout) hyprctl dispatch exit ;; + *Reboot) systemctl reboot ;; + *Shutdown) systemctl poweroff ;; + esac + ''}" # Move windows "$mod SHIFT, left, movewindow, l" @@ -283,16 +296,63 @@ in }; }; - programs.rofi = { + programs.anyrun = { enable = true; - package = pkgs.rofi; - terminal = "${pkgs.ghostty}/bin/ghostty"; - extraConfig = { - show-icons = true; - location = 0; - hide-scrollbar = true; - click-to-exit = true; + config = { + plugins = [ "${pkgs.anyrun}/lib/libapplications.so" ]; + x.fraction = 0.5; + y.fraction = 0.5; + width.fraction = 0.2; + height.absolute = 0; + margin = 16; + hideIcons = false; + ignoreExclusiveZones = false; + layer = "overlay"; + hidePluginInfo = true; + closeOnClick = true; + maxEntries = 8; }; + extraCss = + let c = config.lib.stylix.colors; in + '' + * { all: unset; font-family: "FiraMono Nerd Font", monospace; font-size: 13px; } + window { background: transparent; } + box.main { + background: #${c.base00}; + border: 1px solid #${c.base03}; + border-radius: 10px; + padding: 8px; + margin: 16px; + } + text { + background: #${c.base01}; + color: #${c.base05}; + caret-color: #${c.base0D}; + padding: 8px 16px; + border-radius: 6px; + min-height: 0; + } + list.plugin { background: transparent; } + .matches { background: transparent; } + .match { + padding: 4px 16px; + border-radius: 6px; + color: #${c.base05}; + background: transparent; + } + .match:selected { + background: #${c.base02}; + border: none; + } + label.match.description { color: #${c.base04}; font-size: 11px; } + ''; + extraConfigFiles."applications.ron".text = '' + Config( + desktop_actions: false, + max_entries: Some(8), + terminal: Some("ghostty"), + ) + ''; }; # Scope all HM Wayland services (hyprpaper, waybar, …) to the @@ -311,7 +371,7 @@ in modules-left = [ "hyprland/workspaces" ]; modules-center = [ "clock" ]; - modules-right = [ "group/tray-drawer" "custom/power" ]; + modules-right = [ "group/tray-drawer" ]; "hyprland/workspaces" = { format = "{name}"; @@ -356,21 +416,6 @@ in icon-size = 16; spacing = 8; }; - - "custom/power" = { - format = "⏻"; - tooltip = false; - on-click = "${pkgs.writeShellScript "power-menu" '' - choice=$(printf "Lock\nLogout\nReboot\nShutdown" \ - | ${pkgs.rofi}/bin/rofi -dmenu -p "Power") - case "$choice" in - Lock) ${pkgs.hyprlock}/bin/hyprlock ;; - Logout) hyprctl dispatch exit ;; - Reboot) systemctl reboot ;; - Shutdown) systemctl poweroff ;; - esac - ''}"; - }; }; style = '' @@ -414,8 +459,7 @@ in } #pulseaudio, - #tray, - #custom-power { + #tray { padding: 0 10px; color: @base05; } @@ -425,16 +469,8 @@ in color: @base03; } - #custom-power:hover { - color: @base08; - } - - #custom-power { - margin-right: 6px; - } - #tray { - margin-right: 0; + margin-right: 6px; } #custom-tray-toggle {