Skip to content

Instantly share code, notes, and snippets.

@giovaneliberato
Created August 29, 2014 15:31
Show Gist options
  • Save giovaneliberato/f22e70b5559251d24716 to your computer and use it in GitHub Desktop.
Save giovaneliberato/f22e70b5559251d24716 to your computer and use it in GitHub Desktop.
terminal matrix screensaver
function cmatrix_auto(){
while :
do
read -n 1 -t 100 ch
if [ ! -z "$ch" ]
then
fg
fi
if [ $(xprintidle) -gt 1000 ]
then
cmatrix & CMATRIX_PID=!$
echo $CMATRIX_PID
fi
done
}
cmatrix_auto & CMATRIX_PID=$!
function cmatrix_stop(){
while :
do
read -n 1 -t 100 ch
if [ ! -z "$ch" ]
then
echo 'pid' $CMATRIX_PID
kill -l $CMATRIX_PID
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment