Merge branch 'dev' into gentoo

system: speed up dmenuopen, filter files with `find`
nvim: tweak colorscheme
This commit is contained in:
David JULIEN 2021-10-29 23:00:00 +02:00
commit ceccc122b7
No known key found for this signature in database
GPG Key ID: 4B388E8BD9D47382
3 changed files with 10 additions and 15 deletions

View File

@ -10,22 +10,19 @@
######################################################################
filetypes=".pdf .png .jpg .txt .mom .tex .mkv" # could be augmented
filetypes="pdf png jpg txt mom tex mkv" # could be augmented
filetype=$(printf "$filetypes" | sed "s| |\n|g" | dmenu -i -p "type of the file?")
if [ -z "$filetype" ]; then
exit 0
fi
[ -z "$filetype" ] && exit 1
file=$(find $HOME/ -type f | grep "$filetype" | dmenu -i -l 20 -p "open")
if [ -z "$file" ]; then
exit 0
fi
file=$(find $HOME/{documents,downloads} -type f -path "*.$filetype" | dmenu -i -l 20 -p "open")
[ -z "$file" ] && exit 2
case "$filetype" in
*.pdf) zathura "$file" ;;
*.png|.jpg) sxiv "$file" ;;
*.txt|*.mom|*.tex) "$TERMINAL" -e nvim "$file" ;;
*.mkv) mpv "$file";;
pdf) zathura "$file" ;;
png|jpg) sxiv "$file" ;;
txt|mom|tex) "$TERMINAL" -e nvim "$file" ;;
mkv) mpv "$file";;
esac

View File

@ -46,5 +46,3 @@ else
switch_scheme
fi
fi
exit 0

@ -1 +1 @@
Subproject commit c329ff44d3aef42e8347563bf7ae119b5a2a2d70
Subproject commit d77e1cfe127418ab00c6d5fb076f89cdf9b49e94