Last active
June 14, 2024 04:35
-
-
Save RKursatV/943c4b976c3175a5f1d87aebb6f1c97b to your computer and use it in GitHub Desktop.
A script generates 100 random oneko characters with random colors and random magnitude of speed
This file contains hidden or 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 | |
type oneko >/dev/null 2>&1 || { echo >&2 "I require oneko but it's not installed. Aborting."; exit 1; } | |
array[0]="sakura" | |
array[1]="tomoyo" | |
array[2]="neko" | |
array[3]="dog" | |
array[4]="tora" | |
allcolorsS=$(awk -F ' ' '{print $4}' /etc/X11/rgb.txt | tr "\n" " "); | |
allcolors=($allcolorsS); | |
colorsize=${#allcolors[@]}; | |
size=${#array[@]} | |
for i in {1..100}; | |
do | |
index=$(($RANDOM % $size)); | |
speed=$(($RANDOM % 60 + 16)); | |
backcolor=$(($RANDOM % $colorsize)); | |
forecolor=$(($RANDOM % $colorsize)); | |
oneko -${array[$index]} -speed $speed -fg ${allcolors[$forecolor]} -bg ${allcolors[$backcolor]} 2>>/dev/null & | |
done; |
Author
RKursatV
commented
Aug 27, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment