From: Siraaj Khandkar Date: Fri, 22 Nov 2019 20:55:23 +0000 (-0500) Subject: Add video catalog building and playing X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=f7352c489dce80fbc3a1ae532b205726098f8ab4;p=khome.git Add video catalog building and playing --- diff --git a/home/.xbindkeysrc b/home/.xbindkeysrc index 5eca4dc..3df0a9b 100644 --- a/home/.xbindkeysrc +++ b/home/.xbindkeysrc @@ -109,3 +109,7 @@ # 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 index 0000000..a22b1ac --- /dev/null +++ b/home/bin/video_catalog_play @@ -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 index 0000000..8a1acc3 --- /dev/null +++ b/home/bin/video_catalog_update @@ -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" diff --git a/home/lib/login_variables.sh b/home/lib/login_variables.sh index 403a89b..f219bad 100644 --- a/home/lib/login_variables.sh +++ b/home/lib/login_variables.sh @@ -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