aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/movie
blob: b56828f4ef207a6f043e9d3a29a68ded290067bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash


if [ -t 0 ]; then
    filename="$(find ~/media/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)" -printf "%f\n" | sort | fzf)"
else
    filename="$(find ~/media/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)" -printf "%f\n" | sort | fuzzel  -d -l 25)"
fi

filepath="$(find ~/media/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)")"
mpv "$(grep "$filename" <<< "$filepath")"