From 158c761ae206d297ee283829b9b29934f1a10031 Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Fri, 8 Aug 2025 13:26:38 -0600 Subject: [PATCH] replace wofi with bemenu --- home/modules/gui/default.nix | 1 - home/modules/gui/sway.nix | 20 +++++++--- home/modules/gui/wofi.nix | 74 ------------------------------------ 3 files changed, 14 insertions(+), 81 deletions(-) delete mode 100644 home/modules/gui/wofi.nix diff --git a/home/modules/gui/default.nix b/home/modules/gui/default.nix index 8e19063..2839075 100644 --- a/home/modules/gui/default.nix +++ b/home/modules/gui/default.nix @@ -52,7 +52,6 @@ in { ./theme.nix ./sway.nix ./waybar.nix - ./wofi.nix ]; config = mkIf cfg.enable { diff --git a/home/modules/gui/sway.nix b/home/modules/gui/sway.nix index 0d38b77..eeb51c6 100644 --- a/home/modules/gui/sway.nix +++ b/home/modules/gui/sway.nix @@ -8,10 +8,16 @@ with lib; let cfg = config.local.gui; in { config = mkIf cfg.enable { - home.packages = [ - pkgs.wlr-randr + home.packages = with pkgs; [ + wlr-randr + bemenu ]; + home.sessionVariables = { + "BEMENU_BACKEND" = "wayland"; + "BEMENU_RENDERER" = "bemenu-wlroots"; + }; + services = { swayidle = { enable = true; @@ -43,7 +49,7 @@ in { cfg.monitors; modifier = "Mod4"; - + focus = { followMouse = true; wrapping = "workspace"; @@ -85,6 +91,8 @@ in { titlebar = false; }; + menu = "bemenu-run"; + workspaceLayout = "tabbed"; colors = { @@ -128,17 +136,17 @@ in { keybindings = let mod = config.wayland.windowManager.sway.config.modifier; - wofi = config.programs.wofi.package; - grimshot = getExe pkgs.sway-contrib.grimshot; + bemenuCommand = ''bemenu-run --center --width-factor 0.2 --fixed-height --list 10 --scrollbar none --auto-select --accept-single --fn "JetBrains Mono 12" --prompt "" --tb "#000000" --tf "#EAEAEA" --fb "#000000" --ff "#EAEAEA" --cb "#EAEAEA" --cf "#000000" --nb "#000000" --nf "#EAEAEA" --sb "#000000" --sf "#EAEAEA" --hb "#000000" --hf "#EAEAEA" --fbb "#000000" --fbf "#000000" --ab "#000000" --af "#EAEAEA"''; in mkOptionDefault { "${mod}+a" = "focus parent"; "${mod}+c" = "focus child"; - "${mod}+d" = "exec --no-startup-id ${getExe wofi} -S run"; + "${mod}+d" = "exec ${bemenuCommand}"; "${mod}+l" = "exec ${getExe pkgs.gtklock} -d"; "${mod}+Return" = "exec ${lib.getExe pkgs.kitty} ${lib.getExe pkgs.tmux}"; "${mod}+Shift+s" = "exec ${grimshot} copy area"; + "${mod}+Shift+a" = "exec ${grimshot} copy active"; "${mod}+Tab" = "focus right"; "${mod}+Shift+Tab" = "focus left"; "${mod}+Shift+w" = "move workspace to output right"; diff --git a/home/modules/gui/wofi.nix b/home/modules/gui/wofi.nix deleted file mode 100644 index 2eb56c7..0000000 --- a/home/modules/gui/wofi.nix +++ /dev/null @@ -1,74 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.local.gui; -in { - config = mkIf cfg.enable { - programs = { - wofi = { - enable = true; - settings = { - prompt = ""; - width = "25%"; - height = "30%"; - }; - style = '' - window { - background-color: rgb(0, 0, 0); - color: #eaeaea; - font-family: monospace; - font-size: 12px; - border: none; - border-radius: 0; - padding: 0; - width: 50%; /* half screen width */ - } - - /* Search input */ - #input { - background-color: rgba(0, 0, 0, 0.5); - color: #ffffff; - padding: 4px 6px; - border: none; - border-radius: 0; - margin: 0; - } - - /* Results list container */ - #inner-box { - background-color: transparent; - margin: 0; - padding: 0; - } - - /* Entries */ - #entry { - padding: 2px 6px; - margin: 0; - border-radius: 0; - background-color: transparent; - color: #cccccc; - } - - /* Text inside entries */ - #text { - padding: 0; - margin: 0; - } - - /* Scrollbar */ - scrollbar { - background: transparent; - } - scrollbar slider { - background: rgba(255, 255, 255, 0.15); - } - ''; - }; - }; - }; -}