GithubHelp home page GithubHelp logo

lateralus138 / colorstatic-bash Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 3.95 MB

Fun Bash hybrid function/script to generate a random colorful "Static"/"Matrix" (like?) style animation in a Linux (or any *nix?) command line.

License: GNU General Public License v3.0

Shell 100.00%

colorstatic-bash's Introduction

Color Static (Bash Edition)

ColorStatic Logo


New Version

NOTE: I strongly recommend this new version.

This has been re-written in C++ which is far more performant than this version and isn't dependent on Bash.

The new version can be found here:

Color Static (C++ Edition)


This Version Is Not Recommended.

This project is archived in essence, but still open to the public; just not maintained.

As stated above I do not recommend this version over the new C++ version that I do recommend which is linked above or the ☞ new version here ☜.


  1. New Version
  2. This Version Is Not Recommended.
  3. About
    1. Description
    2. Motivation
    3. Disclaimer
  4. Usage
    1. Dependency
    2. Distribution
    3. Use
      1. Permissions
      2. Script and Function
        1. Source and Execute as a Function
          1. Source the Function
          2. Execute as a function
        2. Execute as a Script
      3. AppImage
    4. Examples
      1. Basic Execution
      2. Quarter Screen with a Delay
      3. Using Alternative Characters
  5. Environment and Status
    1. Status
      1. File Status
      2. Project Status
      3. Latest Version Status
      4. Code Quality
    2. License
  6. All Files
  7. Media
    1. Screenshots
      1. Help Screen
      2. Main Static
      3. Latin Based Characters and digits.
      4. Linux Bash
    2. YouTube Videos

About

Twitter URL

Description

Fun Bash hybrid function/script to generate a random colorful "Static"/"Matrix" (like?) style animation in a Linux (or any *nix?) command line.

Motivation

Some time ago (more than a few handfuls of years?) I ran across this static style loop example and the other style of generic matrix (with a little 'm') style script and I have since been facinated with fun, quirky, and geeky things in the command line; no matter how redundant and time wasting. :D

With this function, though, it's not so time wasting as showing this to younger or newer people (my children, for example) can help them understand a few things about the way various things in the code works and if used in the right way it can be a temporary, sort of screensaver while background tasks are running. For example, when I run something and I have to take care of my kids or do work or otherwise, I can keep it running on-screen to look cool.

I have recenty created this more advanced and reusable version of the fun code and added more randomness and color to it with various features and uses.

Disclaimer

I did not come up with this initial concept of looping this command; this is, of course, inherit in the printf command and only the creators can claim it and I'm really not sure who to give credit to; though I would gladly do so.

Having said that, 99.99% of the code and everything here is my creation.


Usage

Dependency

This is dependant on the Bash shell command line as it is created with Bashisms.

Distribution

There are two ways to use this:

  1. A hybrid sourceable/executable function/script (respectively); the function having Bash Completion.
  2. An executable only AppImage[ 1: DDG Search ].

Use

Permissions

Any executable file's permission's must must be set to executable:

 # Executable for self only
 $ chmod u+x /path/to/colorstatic.bash # or .AppImage
 # Executable all
 $ chmod +x /path/to/colorstatic.bash # or .AppImage

Script and Function

The script can be executed with arguments or sourced into a script or config file as a function with Bash completion.

The AppImage can only be executed with arguments as it is an executable.

You can, of course, change the files name's (colorstatic.bash and colorstatic.AppImage) to whatever you want.

Source and Execute as a Function
Source the Function
 $ . /path/to/colorstatic.bash
 # Or; assuming [[ -d "$HOME/.bash/functions/" ]] or whatever
 $ source $HOME/.bash/functions/colorstatic.bash
Execute as a function
 $ colorstatic --help

 USAGE: colorstatic [OPTION]...
 Basic random color animations in the command line.

 OPTION:
     -h,--help       This help screen.
     -d,--delay      Delay between iterations.
     -l,--lines      Number of lines; height.
     -c,--columns    Number of columns; width.
                     Setting LINES and COLUMNS
                     implicitly will make it
                     run faster. If they are not
                     set this will change size
                     on terminal size change.
     -p,--parts      String of random parts.
                     Defaults to "█ ░ ▒ ▓".
Execute as a Script
 $ /path/to/colorstatic.bash --help
 # or if in $PATH:
 $ colorstatic.bash --help # or ./colorstatic.bash --help
 # Output same as the above function

AppImage

The AppImage can be assumed to be exactly like and can be executed in the EXACT same way as the executable script.

Examples

The examples are better viewed in my YouTube demonstrations since they are animated, but here's a few that shows what it will look like to type them out.

Basic Execution

Basic execution with all defaults. This method allows it to change character width and height upon terminal resizing.

 $ colorstatic

Quarter Screen with a Delay

Set it to a quarter of the current terminal size and slow it down.

 $ colorstatic --lines $((LINES/2)) --columns $((COLUMNS/2)) --delay 0.5
 # or
 $ colorstatic -l $((LINES/2)) -c $((COLUMNS/2)) -d 0.5
 # In a script you should use `$(tput lines)` and `$(tput cols)`
 # in place of LINES and COLUMNS

Using Alternative Characters

By default the displayed characters will be: █ ░ ▒ ▓, but you can use whatever string or array of characters you like as long as you can display them correctly in your terminal.

You can do this with the -p,--parts switch.

 $ colorstatic --parts '\ /'
 # or create array of all decimal ints and lower and upper
 # case Latin based characters 
 $ chars="$(printf '%d ' {0..9};printf '%s ' {a..z} {A..Z})"
 $ colorstatic --parts "$chars"

Find video demonstrations with versions of these examples in the list of videos below in the Media secion: YouTube Videos.


Environment and Status

Environment
Language Bash
Environment Shell
Skill Fun

Status

File Status

Script Test
Script Test
Script MD5
AppImage Build
AppImage Build
AppImage MD5

Project Status

Description Status
Last Push Time Last Push
Project Release Date GitHub Release Date
Total downloads for this project GitHub all releases
Complete repository size This Repo Size
Commits in last month GitHub commit activity
Commits in last year GitHub commit activity

Latest Version Status

Description Status
Release version Release Version
Tag version Tag Version
Total downloads for current version GitHub release (latest by date)

Code Quality

Name Code Quality
colorstatic.bash Code colorstatic.bash Code

License

View this license:


All Files

All files can be found in the Continuous Build page in the Release section:

Continuous Build


Media

Screenshots

Help Screen

Help Screen

Main Static

Main Static

Latin Based Characters and digits.

Latin Based Characters

Linux Bash

Linux Bash

YouTube Videos

Thumbnail Link - Newest to Oldest
Demo 3 https://youtu.be/GyNQpkrmv50
Demo 2 https://youtu.be/-R8tEdHDCpE
Demo 1 https://youtu.be/jSZO-oy7xqI

If you like this project and care to donate to my PayPal:

PayPal Donation

colorstatic-bash's People

Contributors

lateralus138 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.