dotfiles

regexghost dotfiles and scripts
git clone https://git.regexghost.com/dotfiles.git
Log | Files | Refs | README

vid-play.sh (423B)


      1 #!/bin/sh
      2 
      3 LOC="$HOME/Videos/YouTube"
      4 
      5 if [ "$1" = "-s" ] || [ "$1" = "s" ]; then
      6 	dir="Shorts"
      7 else
      8 	dir="Videos"
      9 fi
     10 
     11 vid="$(find "${LOC}/${dir}/" -type f | sed "s|${LOC}/${dir}/||g" | fzf)"
     12 
     13 [ "$vid" = "" ] && exit
     14 
     15 fullpath="${LOC}/${dir}/${vid}"
     16 
     17 ${VIDEO_PLAYER:-mpv} "$fullpath"
     18 
     19 read -p "Delete video? (y/N) " yesOrNoDelete
     20 
     21 if [ "$yesOrNoDelete" = "y" ] || [ "$yesOrNoDelete" = "Y" ]; then
     22 	trash-put "$fullpath"
     23 fi