From 5718c65a7c47b9b7e351e303e8c6c82603163bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Tue, 16 Aug 2022 09:44:14 -0300 Subject: [PATCH] make rofi case insensitive --- scripts/wpass.nix | 6 +++--- user/kak/usermode.kak | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/wpass.nix b/scripts/wpass.nix index 7589886..1194f86 100644 --- a/scripts/wpass.nix +++ b/scripts/wpass.nix @@ -4,12 +4,12 @@ pkgs.writeShellScriptBin "wpass" '' wtype=${pkgs.wtype}/bin/wtype # dmenu=${pkgs.bmenu}/bin/bmenu - dmenu="rofi -dmenu" + dmenu="rofi -dmenu -i" find_file() { ${pkgs.fd}/bin/fd --strip-cwd-prefix '\.gpg$' | ${pkgs.sd}/bin/sd ".gpg$" "" | - "$dmenu" -p "Password" $@ + $dmenu -p "Password" $@ } main() { @@ -25,7 +25,7 @@ pkgs.writeShellScriptBin "wpass" '' username=`${pkgs.pass}/bin/pass show "$entry" 2>/dev/null | perl -ne 'print $2 if /^(login|user|email): (.*)/'` password=`${pkgs.pass}/bin/pass show "$entry" 2>/dev/null | head -n 1` - action=`printf "Autotype\nUsername -> $username\nPassword" | "$dmenu" -p Action` + action=`printf "Autotype\nUsername -> $username\nPassword" | $dmenu -p Action` case $action in Autotype) diff --git a/user/kak/usermode.kak b/user/kak/usermode.kak index 785e387..501e598 100644 --- a/user/kak/usermode.kak +++ b/user/kak/usermode.kak @@ -56,48 +56,48 @@ map global find 'd' ': find_delete' -docstring 'file to delete' define-command -override -hidden find_file \ %{ evaluate-commands %sh{ - for line in `fd --strip-cwd-prefix -tf -HE .git | rofi -dmenu`; do + for line in `fd --strip-cwd-prefix -tf -HE .git | rofi -dmenu -i -p "File: "`; do echo "edit '$line'" done } } define-command -override -hidden find_delete \ %{ nop %sh{ - fd --strip-cwd-prefix -H -E .git -t f | rofi -dmenu | xargs -r trash + fd --strip-cwd-prefix -H -E .git -t f | rofi -dmenu -i | xargs -r trash } } define-command -override -hidden find_git_file \ %{ evaluate-commands %sh{ - for line in `git ls-files | rofi -dmenu`; do + for line in `git ls-files | rofi -dmenu -i`; do echo "edit -existing '$line'" done } } define-command -override -hidden find_git_modified \ %{ evaluate-commands %sh{ - for line in `git status --porcelain | sd '^.. ' ''| rofi -dmenu`; do + for line in `git status --porcelain | sd '^.. ' ''| rofi -dmenu -i`; do echo "edit -existing '$line'" done } } define-command -override -hidden find_dir \ %{ cd %sh{ - for line in `fd --strip-cwd-prefix -Htd | rofi -dmenu`; do + for line in `fd --strip-cwd-prefix -Htd | rofi -dmenu -i`; do echo "edit '$line'" done } } define-command -override -hidden find_buffer \ %{ evaluate-commands %sh{ - for line in `printf "%s\n" $kak_buflist | rofi -dmenu`; do + for line in `printf "%s\n" $kak_buflist | rofi -dmenu -i`; do echo "buffer '$line'" done } } define-command -override -hidden find_ripgrep \ %{ evaluate-commands %sh{ - patter=$( rofi -dmenu -p "Regex") - rg --column -n "$patter" | rofi -dmenu | + patter=$( rofi -dmenu -i -p "Regex") + rg --column -n "$patter" | rofi -dmenu -i | perl -ne 'print "edit \"$1\" \"$2\" \"$3\" " if /(.+):(\d+):(\d+):/' } } @@ -108,7 +108,7 @@ define-command -override -hidden find_line \ line=$( printf "%s\n" "$kak_reg_a" | nl -ba -w1 | - rofi -dmenu -p "Line" | + rofi -dmenu -i -p "Line" | cut -f1 ) test -n "$line" && echo "${line}gx"