Skip to content

Instantly share code, notes, and snippets.

@Jcpetrucci
Created January 3, 2019 21:21
Show Gist options
  • Save Jcpetrucci/372b7a266b382ff81de47ef2991098dd to your computer and use it in GitHub Desktop.
Save Jcpetrucci/372b7a266b382ff81de47ef2991098dd to your computer and use it in GitHub Desktop.
mostly stagnant screen
#!/bin/bash
# made this to test the impact of changing a small part of the whole screen versus script(1) file size
export rows=$(tput lines); export cols=$(tput cols);
while :; do
( exec > .tmp-screen-changer.sh;
for r in $(seq 1 $rows); do
for i in $(seq 1 $cols); do
if (( $r == $rows / 2 )); then
if (( $i > $cols / 2 - 10 && $i < $cols / 2 + 10 )); then
printf '%s' $(head -c 1 <(tr -d -c '[:alpha:]' </dev/urandom))
else
printf '%s' X
fi
else
printf '%s' X
fi
done
done )
clear
cat .tmp-screen-changer.sh
sleep 0.1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment