Last active
October 10, 2022 12:25
-
-
Save poulou0/e9b5ded907122b6b5c5a94502ed64dee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A sample script for raspberry pi with 3.5 lcd, by poulou | |
normal=$(cat << EOF | |
██████████ ██████████ | |
██████ ████ ████ ██████ | |
██████ ████ ████ ██████ | |
██████ ████ ████ ██████ | |
████████ ██████ ██████ ████████ | |
██████████████████ ██████████████████ | |
██████████████████ ██████████████████ | |
██████████████ ██████████████ | |
██████████ ██ ██ ██ ██████████ | |
████ ████ | |
EOF | |
) | |
blink=$(cat << EOF | |
██████████ ██████████ | |
██ ██ ██ ██ | |
██ ██ ██ ██ | |
██ ██ ██ ██ | |
██ ██ ██ ██ | |
██ ██ ██ ██ | |
██ ██ ██ | |
████ ████ | |
EOF | |
) | |
while true; do | |
stats=$(cat << EOF | |
cpuname=$(lscpu | awk '/Model name:/{print $3}') | |
$(vcgencmd measure_temp) | |
freeRAM=$(free | awk '/Mem/{printf("%.2f\n"), $4/1024}')MB | |
$(ps -eo pcpu,pid,user,args | sort -k 1 -r | head -4) | |
EOF | |
) | |
choice=$(shuf -i 1-8 -n 1) | |
duration=$(shuf -i 1-8 -n 1) | |
if [[ $choice -eq 1 ]]; then | |
timeout --foreground $duration asciiquarium | |
elif [[ $choice -eq 2 ]]; then | |
timeout --foreground $duration cmatrix | |
elif [[ $choice -eq 3 ]]; then | |
printf "$blink" | |
printf "\n\n%s\n" "${stats}" | cut -c -60 | |
sleep 0.5 | |
# elif [[ $rand -eq 4 ]]; then | |
# timeout --foreground 5s aafire | |
else | |
printf "$normal" | |
printf "\n\n%s\n" "${stats}" | cut -c -60 | |
sleep $duration | |
fi | |
clear | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A sample Bash script, by Ryan | |
normal=$(cat << EOF | |
\n\n\n\n | |
██████ ██████ | |
█████ ███ ███ █████ | |
█████ ███ ███ █████ | |
█████ ███ ███ █████ | |
███████ █████ █████ ███████ | |
██████████ ██████████ | |
██████ ██ ██ ██ ██████ | |
███ ███ | |
\n\n\n\n | |
EOF | |
) | |
blink=$(cat << EOF | |
\n\n\n\n | |
██████ ██████ | |
██ ██ ██ ██ | |
██ ██ ██ ██ | |
██ ██ ██ ██ | |
██ ██ ██ ██ | |
██ ██ ██ | |
███ ███ | |
\n\n\n\n | |
EOF | |
) | |
function i_love_you() { | |
clear && printf "\n\n\n\n\n\n\n\n\n" && toilet -f smblock -F border --gay " love you " && \ | |
printf "\n\n so sooo very much and im here for you\n\n\n beijinhos\n :)\n\n"; \ | |
d1=$(date -d "5/18/2021 15:00" +%s); d2=$(date +%s); seconds=$(( (d1 - d2) )); \ | |
date1=$((`date +%s` + $seconds)); while [ "$date1" -ge `date +%s` ]; \ | |
do echo -ne " $(( (d1 - d2) / 86400 )) days and $(date -u --date @$(($date1 - `date +%s` )) +%H:%M:%S)\r"; done | |
} | |
while true; do | |
stats=$(cat << EOF | |
cpuname=$(lscpu | awk '/Model name:/{print $3}') | |
$(vcgencmd measure_temp) | |
freeRAM=$(free | awk '/Mem/{printf("%.2f\n"), $4/1024}')MB | |
$(ps -eo pcpu,pid,user,args | sort -k 1 -r | head -4) | |
EOF | |
) | |
choice=$(shuf -i 1-6 -n 1) | |
duration=$(shuf -i 1-8 -n 1) | |
if [[ $choice -eq 1 ]]; then | |
timeout --foreground $(($duration + 5)) asciiquarium | |
elif [[ $choice -eq 2 ]]; then | |
timeout --foreground $duration cmatrix | |
elif [[ $choice -eq 3 ]]; then | |
printf "$blink" | |
printf "\n\n%s\n" "${stats}" | cut -c -60 | |
sleep 0.5 | |
elif [[ $choice -eq 4 ]]; then | |
i_love_you | |
sleep $duration | |
# elif [[ $rand -eq 4 ]]; then | |
# timeout --foreground 5s aafire | |
else | |
printf "$normal" | |
printf "\n\n%s\n" "${stats}" | cut -c -60 | |
sleep $duration | |
fi | |
clear | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment