Krolyxon
Commit f37b83c

Branches

Refs →

dotfiles-x11f37b83c

add movie script

Author
krolxon
Date
2023-11-10 00:22 +0530
Parent
793b8d7
Commit
f37b83c5fa9acf7aa5b069776d38ecbd6602f299

+17 −5

2 files changed

  1. M .config/shell/aliasrc +5 −5
  2. A .local/bin/movie +12 −0
M .config/shell/aliasrc View
@@ -49,8 +49,8 @@ colors() {
4949 done
5050 echo
5151 }
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+# }
A .local/bin/movie View
@@ -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+