dotfiles-x11f37b83c
add movie script
+17 −5
2 files changed
- M .config/shell/aliasrc +5 −5
- A .local/bin/movie +12 −0
| @@ -49,8 +49,8 @@ colors() { | |||
| 49 | 49 | done | |
| 50 | 50 | echo | |
| 51 | 51 | } | |
| 52 | − | movie() { | |
| 53 | − | filename="$(find ~/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)" -printf "%f\n" | fzf)" | |
| 54 | − | filepath="$(find ~/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)")" | |
| 55 | − | mpv "$(grep "$filename" <<< "$filepath")" | |
| 56 | − | } | |
| 52 | + | # movie() { | |
| 53 | + | # filename="$(find ~/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)" -printf "%f\n" | fzf)" | |
| 54 | + | # filepath="$(find ~/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)")" | |
| 55 | + | # mpv "$(grep "$filename" <<< "$filepath")" | |
| 56 | + | # } | |
| @@ -0,0 +1,12 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | ||
| 3 | + | ||
| 4 | + | if [ -t 0 ]; then | |
| 5 | + | filename="$(find ~/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)" -printf "%f\n" | fzf)" | |
| 6 | + | else | |
| 7 | + | filename="$(find ~/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)" -printf "%f\n" | dmenu -l 25)" | |
| 8 | + | fi | |
| 9 | + | ||
| 10 | + | filepath="$(find ~/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)")" | |
| 11 | + | mpv "$(grep "$filename" <<< "$filepath")" | |
| 12 | + | ||