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


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

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