35 lines
947 B
Bash
Executable File
35 lines
947 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
$cecho = '/gmgauthier/.local/bin/cecho';
|
|
|
|
function border () {
|
|
local str="$*" # Put all arguments into single string
|
|
local len=${#str}
|
|
local i
|
|
for ((i = 0; i < len + 4; ++i)); do
|
|
printf '-'
|
|
done
|
|
printf '\n| %s |\n' "$str"
|
|
for ((i = 0; i < len + 4; ++i)); do
|
|
printf '-'
|
|
done
|
|
echo
|
|
}
|
|
|
|
clear
|
|
border "Internet Video Console"
|
|
echo
|
|
read -p "Search For: " searchphrase
|
|
|
|
ytfzf --detach --notify-playing --ytdl-pref="[height <=? 720]" --sort-by="upload_date" --pages=3 "${searchphrase}"
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
/home/gmgauthier/.local/bin/cecho "IYellow" "On_Blue" "There are no results for '${searchphrase}'";
|
|
read -p "Press any key to exit... " -n1 -s
|
|
else
|
|
# needed because immediate exit was destroying the handshake between alacritty and ytfzf
|
|
/home/gmgauthier/.local/bin/cecho "Green" "On_Black" "Your video will play momentarily..."
|
|
sleep 5
|
|
fi
|
|
exit 0
|