make rofi case insensitive

This commit is contained in:
Leonardo Eugênio 2022-08-16 09:44:14 -03:00
parent 4f7938192c
commit 5718c65a7c
2 changed files with 12 additions and 12 deletions

View File

@ -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)

View File

@ -56,48 +56,48 @@ map global find 'd' ': find_delete<ret>' -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"