From 60152f2e929740f8077fe5d54393d5ecfdd23654 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 4 Mar 2025 20:32:45 +0000 Subject: [PATCH] Remove blank lines from the suggestions My Neovim configuration always adds a blank line to the end of a file that I don't want to be included in my suggestions. Using `grep "\S"` was working in a Terminal but this broke when adding it to my dwm configuration. This approach works in dwm when triggered with the keyboard shortcut. --- nix/modules/nixos/features/desktop/dwm.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/modules/nixos/features/desktop/dwm.nix b/nix/modules/nixos/features/desktop/dwm.nix index 9815c81..93319c6 100644 --- a/nix/modules/nixos/features/desktop/dwm.nix +++ b/nix/modules/nixos/features/desktop/dwm.nix @@ -118,7 +118,7 @@ with lib; { MODKEY|ShiftMask, XK_q, quit, {0} }, { MODKEY|ShiftMask, XK_b, spawn, SHCMD("${pkgs.firefox}/bin/firefox") }, { MODKEY|ShiftMask, XK_f, spawn, SHCMD("${pkgs.xfce.thunar}/bin/thunar") }, - { MODKEY|ShiftMask, XK_i, spawn, SHCMD("${pkgs.xdotool}/bin/xdotool type $(grep -v '^#' ~/snippets.txt | grep "\S" | sort | dmenu -i -l 50 | cut -d' ' -f1)") }, + { MODKEY|ShiftMask, XK_i, spawn, SHCMD("${pkgs.xdotool}/bin/xdotool type $(cat ~/snippets.txt | grep -v '^#' | grep -v '^$' | sort | dmenu -i -l 50 | cut -d' ' -f1)") }, { MODKEY|ShiftMask, XK_s, spawn, SHCMD("${pkgs.flameshot}/bin/flameshot gui") }, { MODKEY|ShiftMask, XK_y, spawn, SHCMD("${pkgs.copyq}/bin/copyq toggle") }, };