johnsu01 (johnsu01) wrote,
johnsu01
johnsu01

random-terminal-style.sh

Here is a bash script I threw together to randomly select a set of options to pass to the terminal command. I started writing something that just randomly selected a background image from a directory, and that worked, but was pretty useless since the font color needs to be adjusted based on the background image.

#!/bin/bash

background_image_path="/home/johnsu01/images/random-backgrounds"
my_font="-sony-fixed-medium-*-*-*-*-*-*-*-*-*-*-*"
STYLES=8

terminal_style=\
("-fg #A9A9A9 +sb -pixmap $background_image_path/nebula.xpm -bgtype tile -fn $my_font"
"-fg #A9A9A9 +sb -pixmap $background_image_path/circuit.xpm -bgtype tile -fn $my_font"
"-fg cyan +sb -pixmap $background_image_path/circuit.xpm -bgtype tile -fn $my_font"
"-fg #A9A9A9 +sb -pixmap $background_image_path/nebula.xpm -bgtype tile -fn $my_font"
"-fg cyan +sb -pixmap $background_image_path/Pop-The-Clutch-1.xpm -bgtype tile -fn $my_font"
"-fg cyan +sb -pixmap $background_image_path/Livid-Pink-Warts-5.xpm -bgtype tile -fn $my_font" 
"-fg cyan +sb -sh 70 -pixmap $background_image_path/Island-of-Elba.xpm -bgtype tile -fn $my_font"
"-fg 'alice blue' +sb -pixmap $background_image_path/Wrestling-Dog-1.xpm -bgtype tile -fn $my_font")

choice=$RANDOM
let "choice %= $STYLES"

aterm ${terminal_style[choice]}
Tags: bash, script
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments