updated pkgbuild, changed theme

This commit is contained in:
Sohrab Behdani 2024-11-17 01:47:17 +03:30
parent 93b6832027
commit e85e2c46b2
8 changed files with 87 additions and 542 deletions

View file

@ -1,8 +1,41 @@
function fireworks() {
if ! command -v lolcat &>/dev/null || ! command -v pv &>/dev/null; then
echo "Install 'lolcat' and 'pv' to use this function: sudo pacman -S lolcat pv"
return 1
fi
fireworks() {
# Check for lolcat
if ! command -v lolcat &>/dev/null; then
echo "Please install 'lolcat': sudo pacman -S lolcat" >&2
return 1
fi
echo "🎆🎇 BOOM! 🎆🎇" | pv -qL 10 | lolcat
}
# Simpler firework patterns
local -a firework=(
" * "
" * * * "
"* * * * *"
" | "
)
clear
while true; do
# Print some random fireworks
for ((i=0; i<3; i++)); do
position=$((RANDOM % 70))
spaces=$(printf '%*s' $position '')
for pattern in "${firework[@]}"; do
echo "${spaces}${pattern}" | lolcat -f
sleep 0.1
done
# Add explosion effect
echo "${spaces} * * * " | lolcat -f
echo "${spaces} * * * " | lolcat -f
echo "${spaces}* * *" | lolcat -f
sleep 0.2
done
# Check for keyboard input to exit
read -t 0.1 -n 1 input
if [[ $? -eq 0 ]]; then
break
fi
done
echo

View file

@ -1,12 +1,24 @@
function typewriter() {
if [ -z "$1" ]; then
echo "Usage: typewriter <text>"
return 1
fi
typewriter() {
# Check if an argument is provided
if [ $# -eq 0 ]; then
echo "Usage: typewriter <text>" >&2
return 1
fi
for ((i=0; i<${#1}; i++)); do
echo -n "${1:i:1}"
sleep 0.05
done
echo
}
local text="$1"
local len
# Get length of string in characters (not bytes)
len=$(echo -n "$text" | wc -m)
# Iterate through each character using AWK
echo -n "$text" | awk '{
split($0, chars, "")
for (i = 1; i <= length($0); i++) {
printf "%s", chars[i]
system("sleep 0.05")
fflush()
}
}'
echo
}