Remove dmenu from find-edit script
This commit is contained in:
parent
91492553cb
commit
ed6096da2d
1 changed files with 4 additions and 14 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ignore="-not -path */.git/*"
|
ignore='-not -path "*/.*/*"'
|
||||||
|
|
||||||
while test $# != 0
|
while test $# != 0
|
||||||
do
|
do
|
||||||
|
@ -16,20 +16,10 @@ if [ -f "$1" ]
|
||||||
then
|
then
|
||||||
$EDITOR $1
|
$EDITOR $1
|
||||||
else
|
else
|
||||||
if which fzf > /dev/null
|
file=$(sh -c "find . $ignore -type f" | fzf -m -1 -q "$*")
|
||||||
then
|
if [ "$?" -eq 0 ]
|
||||||
file=$(find . $ignore -type f | fzf -m -1 -q "$*")
|
|
||||||
found=$?
|
|
||||||
elif which dmenu > /dev/null
|
|
||||||
then
|
|
||||||
file=$(find . $ignore -type f -name '*'"$1"'*' | sed -e 's/^\.\///' | dmenu -l 20)
|
|
||||||
found=$?
|
|
||||||
else
|
|
||||||
echo "Found neither fzf nor dmenu"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$found" -eq 0 ]
|
|
||||||
then
|
then
|
||||||
echo "$file" | xargs -d '\n' $EDITOR
|
echo "$file" | xargs -d '\n' $EDITOR
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue