add build script

This commit is contained in:
meshya 2024-11-17 01:18:06 +03:30
commit e9bdeae0b7
7 changed files with 141 additions and 15 deletions

View file

@ -0,0 +1,7 @@
function flip-coin() {
if (( RANDOM % 2 == 0 )); then
echo "🪙 Heads!"
else
echo "🪙 Tails!"
fi
}

View file

@ -0,0 +1,5 @@
function dice() {
local sides="${1:-6}" # Default to a 6-sided die
echo "🎲 Rolling a ${sides}-sided die..."
echo "You got: $((RANDOM % sides + 1))"
}

View file

@ -0,0 +1,8 @@
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
echo "🎆🎇 BOOM! 🎆🎇" | pv -qL 10 | lolcat
}

View file

@ -0,0 +1,4 @@
function genpass() {
local length="${1:-16}"
tr -dc 'A-Za-z0-9!@#$%^&*()_+-=' </dev/urandom | head -c "$length" ; echo
}

View file

@ -0,0 +1,12 @@
function typewriter() {
if [ -z "$1" ]; then
echo "Usage: typewriter <text>"
return 1
fi
for ((i=0; i<${#1}; i++)); do
echo -n "${1:i:1}"
sleep 0.05
done
echo
}

View file

@ -0,0 +1,18 @@
function weather() {
if [ -z "$1" ]; then
echo "Usage: weather <city>"
return 1
fi
local weather
weather=$(curl -s "wttr.in/$1?format=%C")
case "$weather" in
*Clear*) echo "☀️ It's sunny in $1!" ;;
*Cloud*) echo "☁️ It's cloudy in $1!" ;;
*Rain*) echo "🌧️ It's raining in $1!" ;;
*Snow*) echo "❄️ It's snowing in $1!" ;;
*Storm*) echo "⛈️ There's a storm in $1!" ;;
*) echo "🌦️ The weather in $1 is: $weather" ;;
esac
}