summaryrefslogtreecommitdiffstats
path: root/.local/bin/sortunsorted
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/sortunsorted')
-rwxr-xr-x.local/bin/sortunsorted78
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