diff options
author | msglm <msglm@techchud.xyz> | 2023-01-14 10:33:04 -0600 |
---|---|---|
committer | msglm <msglm@techchud.xyz> | 2023-01-14 10:33:04 -0600 |
commit | 0d05ef1e12314985988e567ac22a179d0f646899 (patch) | |
tree | de702ad5f7550a27a6fb982e617363ccaca4fecf /.local/bin/sortunsorted | |
download | msglm-dotfiles-0d05ef1e12314985988e567ac22a179d0f646899.tar.gz msglm-dotfiles-0d05ef1e12314985988e567ac22a179d0f646899.tar.bz2 msglm-dotfiles-0d05ef1e12314985988e567ac22a179d0f646899.zip |
Inital Commit
Diffstat (limited to '.local/bin/sortunsorted')
-rwxr-xr-x | .local/bin/sortunsorted | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/.local/bin/sortunsorted b/.local/bin/sortunsorted new file mode 100755 index 0000000..7691ca3 --- /dev/null +++ b/.local/bin/sortunsorted @@ -0,0 +1,78 @@ +#!/bin/bash + +#Description: This program takes a paramater for the amount of videos you would like to sort from your UNSORTEDIR. If you do not pass a paramater, it will assume that you only wish to sort one video. These videos are then moved to ~/Videos/ with a new name that you provide or deleted depending on your choice. + +#Axioms: UNSORTEDDIR + +#Dependencies: https://packages.debian.org/sid/mpv + +numofvids=1 +playablevideo="$(find ~/Videos/unsorted/ -maxdepth 1 -type f | shuf | head -1)" + +if [[ $# = 0 ]] +then + if [[ "${playablevideo##*.}" == "png" || "${playablevideo##*.}" == "jpg" || "${playablevideo##*.}" == "jpeg" || "${playablevideo##*.}" == "webp" ]] + then + feh "$playablevideo" + else + mpv --ontop --geometry=50%:50% --autofit=50%x50% "$playablevideo" + fi + echo "Video played was: $playablevideo" + read -r -p "Was This quality? (y/n): " Choice + if [ "$Choice" = 'y' ] + then + read -r -p "What would you like to name the video?: " Name + touch "$playablevideo" + if [[ "${playablevideo##*.}" == "gif" ]] + then + mv "$playablevideo" "/home/$USER/Pictures/gif/$Name.${playablevideo##*.}" + elif [[ "${playablevideo##*.}" == "png" || "${playablevideo##*.}" == "jpg" || "${playablevideo##*.}" == "jpeg" || "${playablevideo##*.}" == "webp" ]] + then + mv "$playablevideo" "/home/$USER/Pictures/$Name.${playablevideo##*.}" + else + mv "$playablevideo" "/home/$USER/Videos/$Name.${playablevideo##*.}" + fi + + exit + elif [ "$Choice" = 'n' ] + then + rm "$playablevideo" + else + echo "You did nothing..." + fi + exit + +fi + +while [[ "$numofvids" -le "$1" ]] +do + if [[ "${playablevideo##*.}" == "png" || "${playablevideo##*.}" == "jpg" || "${playablevideo##*.}" == "jpeg" || "${playablevideo##*.}" == "webp" ]] + then + feh "$playablevideo" + else + mpv --ontop --geometry=50%:50% --autofit=50%x50% "$playablevideo" + fi + echo "Video played was: $playablevideo" + read -r -p "Was This quality? (y/n): " Choice + if [ "$Choice" = 'y' ] + then + read -r -p "What would you like to name the video?: " Name + touch "$playablevideo" + if [[ "${playablevideo##*.}" == "gif" ]] + then + mv "$playablevideo" "/home/$USER/Pictures/gif/$Name.${playablevideo##*.}" + elif [[ "${playablevideo##*.}" == "png" || "${playablevideo##*.}" == "jpg" || "${playablevideo##*.}" == "jpeg" || "${playablevideo##*.}" == "webp" ]] + then + mv "$playablevideo" "/home/$USER/Pictures/$Name.${playablevideo##*.}" + else + mv "$playablevideo" "/home/$USER/Videos/$Name.${playablevideo##*.}" + fi + elif [ "$Choice" = 'n' ] + then + rm "$playablevideo" + else + echo "You did nothing..." + fi + playablevideo="$(find ~/Videos/unsorted/ -maxdepth 1 -type f | shuf | head -1)" + numofvids=$numofvids+1 +done |