1
0
Fork 0
dot/.local/bin/fuzzel_open.sh

26 lines
469 B
Bash
Raw Normal View History

2024-02-04 16:24:33 +01:00
#!/bin/sh
while getopts "he:" arg; do
case $arg in
e)
if [ -z "$excludes" ]; then
excludes="-path $OPTARG"
else
excludes="$excludes -o -path $OPTARG"
fi
;;
[h?])
printf "Usage: %s: [-e exclude path] [path]\n" $0
exit;;
esac
done
shift $(($OPTIND - 1))
file="$(find ${1:-$HOME} ! \( \( $excludes \) -prune \) -print0\
| fuzzel --dmenu0 -p "find > ")"
[ -z "$file" ] && exit
exec xdg-open "$file"