Jump to content

Starry, starry night

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
DarkLordoftheMonkeys

DarkLordoftheMonkeys

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 255 posts
Thanks to Dargueta for the tutorial on generating ANSI color text. I'm using the output of this shell program as my desktop wallpaper:


#!/bin/bash

# This script creates a neat looking space background for the terminal.


for((i=0; i < 1000; i++))

do

	printf "\033[40m";

	declare -i spaces=$RANDOM/1024;

	for((j=0; j < $spaces; j++))

	do

		printf " ";

	done

	colors=([0]="\033[31m" [1]="\033[32m" [2]="\033[33m" [3]="\033[34m" [4]="\033[35m" [5]="\033[36m" [6]="\033[37m");

	declare -i color=$RANDOM%7;

	declare -i plusordot=$RANDOM%4;

	if [ $plusordot -ne 0 ]

	then

		printf "${colors[$color]}.\033[0m";

	else

		printf "${colors[$color]}+\033[0m";

	fi

done

echo "";

unset i j spaces colors color plusordot;


I'm probably going to modify this script to make the bash prompt appear at the top of the terminal window, so you're typing commands over the background.
Life's too short to be cool. Be a nerd.

#2
asafe

asafe

    Programmer

  • Members
  • PipPipPipPip
  • 107 posts
Nice, just need to have the prompt above the background. Maybe you could hack $PS1?