Skip to content

Instantly share code, notes, and snippets.

@RKursatV
Last active June 14, 2024 04:35
Show Gist options
  • Save RKursatV/943c4b976c3175a5f1d87aebb6f1c97b to your computer and use it in GitHub Desktop.
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
#!/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;
@RKursatV
Copy link
Author

ss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment