voidrice/.local/bin/videosearch
2023-11-09 11:25:02 +03:00

5 lines
260 B
Bash

#!/bin/sh
video_files=$(locate -d ~/.config/.mymlocate.db -b -r '.*\.\(mp4\|mkv\|webm\|mov\|m4v\|wmv\|flv\|avi\)$')
chosen_file=$(echo "$video_files" | sed 's|.*/||; s/\.[^.]*$//' | dmenu -p "Select Video")
mpv "$(echo "$video_files" | grep "/$chosen_file.")"