make rofi case insensitive
This commit is contained in:
parent
4f7938192c
commit
5718c65a7c
|
@ -4,12 +4,12 @@ pkgs.writeShellScriptBin "wpass" ''
|
||||||
|
|
||||||
wtype=${pkgs.wtype}/bin/wtype
|
wtype=${pkgs.wtype}/bin/wtype
|
||||||
# dmenu=${pkgs.bmenu}/bin/bmenu
|
# dmenu=${pkgs.bmenu}/bin/bmenu
|
||||||
dmenu="rofi -dmenu"
|
dmenu="rofi -dmenu -i"
|
||||||
|
|
||||||
find_file() {
|
find_file() {
|
||||||
${pkgs.fd}/bin/fd --strip-cwd-prefix '\.gpg$' |
|
${pkgs.fd}/bin/fd --strip-cwd-prefix '\.gpg$' |
|
||||||
${pkgs.sd}/bin/sd ".gpg$" "" |
|
${pkgs.sd}/bin/sd ".gpg$" "" |
|
||||||
"$dmenu" -p "Password" $@
|
$dmenu -p "Password" $@
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
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): (.*)/'`
|
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`
|
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
|
case $action in
|
||||||
Autotype)
|
Autotype)
|
||||||
|
|
|
@ -56,48 +56,48 @@ map global find 'd' ': find_delete<ret>' -docstring 'file to delete'
|
||||||
|
|
||||||
define-command -override -hidden find_file \
|
define-command -override -hidden find_file \
|
||||||
%{ evaluate-commands %sh{
|
%{ 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'"
|
echo "edit '$line'"
|
||||||
done
|
done
|
||||||
} }
|
} }
|
||||||
|
|
||||||
define-command -override -hidden find_delete \
|
define-command -override -hidden find_delete \
|
||||||
%{ nop %sh{
|
%{ 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 \
|
define-command -override -hidden find_git_file \
|
||||||
%{ evaluate-commands %sh{
|
%{ 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'"
|
echo "edit -existing '$line'"
|
||||||
done
|
done
|
||||||
} }
|
} }
|
||||||
|
|
||||||
define-command -override -hidden find_git_modified \
|
define-command -override -hidden find_git_modified \
|
||||||
%{ evaluate-commands %sh{
|
%{ 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'"
|
echo "edit -existing '$line'"
|
||||||
done
|
done
|
||||||
} }
|
} }
|
||||||
|
|
||||||
define-command -override -hidden find_dir \
|
define-command -override -hidden find_dir \
|
||||||
%{ cd %sh{
|
%{ 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'"
|
echo "edit '$line'"
|
||||||
done
|
done
|
||||||
} }
|
} }
|
||||||
|
|
||||||
define-command -override -hidden find_buffer \
|
define-command -override -hidden find_buffer \
|
||||||
%{ evaluate-commands %sh{
|
%{ 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'"
|
echo "buffer '$line'"
|
||||||
done
|
done
|
||||||
} }
|
} }
|
||||||
|
|
||||||
define-command -override -hidden find_ripgrep \
|
define-command -override -hidden find_ripgrep \
|
||||||
%{ evaluate-commands %sh{
|
%{ evaluate-commands %sh{
|
||||||
patter=$( rofi -dmenu -p "Regex")
|
patter=$( rofi -dmenu -i -p "Regex")
|
||||||
rg --column -n "$patter" | rofi -dmenu |
|
rg --column -n "$patter" | rofi -dmenu -i |
|
||||||
perl -ne 'print "edit \"$1\" \"$2\" \"$3\" " if /(.+):(\d+):(\d+):/'
|
perl -ne 'print "edit \"$1\" \"$2\" \"$3\" " if /(.+):(\d+):(\d+):/'
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ define-command -override -hidden find_line \
|
||||||
line=$(
|
line=$(
|
||||||
printf "%s\n" "$kak_reg_a" |
|
printf "%s\n" "$kak_reg_a" |
|
||||||
nl -ba -w1 |
|
nl -ba -w1 |
|
||||||
rofi -dmenu -p "Line" |
|
rofi -dmenu -i -p "Line" |
|
||||||
cut -f1
|
cut -f1
|
||||||
)
|
)
|
||||||
test -n "$line" && echo "${line}gx"
|
test -n "$line" && echo "${line}gx"
|
||||||
|
|
Loading…
Reference in a new issue