Add video catalog building and playing
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 22 Nov 2019 20:55:23 +0000 (15:55 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 22 Nov 2019 20:55:23 +0000 (15:55 -0500)
home/.xbindkeysrc
home/bin/video_catalog_play [new file with mode: 0755]
home/bin/video_catalog_update [new file with mode: 0755]
home/lib/login_variables.sh

index 5eca4dc..3df0a9b 100644 (file)
 # Search mpd lib and play selection
 "mpplay"
     Mod4+p
+
+# Search video catalog and play selection
+"video_catalog_play"
+    Mod4+v
diff --git a/home/bin/video_catalog_play b/home/bin/video_catalog_play
new file mode 100755 (executable)
index 0000000..a22b1ac
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+set -e
+
+LINES=60
+
+file=$(khomenu -l "$LINES" < "$FILE_VIDEO_CATALOG")
+mpv "$file"
diff --git a/home/bin/video_catalog_update b/home/bin/video_catalog_update
new file mode 100755 (executable)
index 0000000..8a1acc3
--- /dev/null
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+
+find "$DIR_VIDEO" \
+    -type f \
+    -print0 \
+| xargs \
+    -0 \
+    -P "$(nproc)" \
+    -I{} \
+    sh -c 'printf "%s %s\n" $(mimetype -b "{}") "{}"' \
+| awk '/^video/ {sub($1 " +", ""); print}' \
+> "$FILE_VIDEO_CATALOG"
index 403a89b..f219bad 100644 (file)
@@ -2,11 +2,13 @@ export PATH=$HOME/bin:/snap/bin:/sbin:/usr/sbin:$PATH
 export EDITOR=vim
 export VISUAL=$EDITOR
 export DIR_GITHUB="${HOME}/Archives/Software/src/repos/remote/github.com"
-export DIR_YOUTUBE="${HOME}/Archives/Videos/Web/youtube.com"
+export DIR_VIDEO="${HOME}/Archives/Videos"
+export DIR_YOUTUBE="${DIR_VIDEO}/Web/youtube.com"
 export DIR_NOTES="$HOME/Documents/Notes"
 export DIR_LOG="$HOME/var/log"
 export DIR_LOG_MPD="$DIR_LOG/mpd"
 export FILE_LOG_MPD="$DIR_LOG_MPD/mpd.log"
+export FILE_VIDEO_CATALOG="$DIR_VIDEO/catalog"
 
 # .Net Core
 export DOTNET_ROOT=$HOME/.dotnet
This page took 0.027392 seconds and 4 git commands to generate.