Git Product home page Git Product logo

bash_loading_animations's Introduction

The ultimate collection of loading animations for Bash

Ready-to-use loading animations in ASCII and UTF-8 for easy integration into your Bash scripts.

Have an idea for a nice-looking animation? Please help expand the collection!

โš  Important note: do not copy the raw script file from your browser or you will have broken animations, as the non-breaking spaces will be converted into regular spaces.

Instead, use one of the following methods to retrieve the script:

git clone https://github.com/Silejonu/bash_loading_animations
curl -O https://raw.githubusercontent.com/Silejonu/bash_loading_animations/main/bash_loading_animations.sh
curl -O https://raw.githubusercontent.com/Silejonu/bash_loading_animations/main/bash_loading_animations.demo
wget https://raw.githubusercontent.com/Silejonu/bash_loading_animations/main/bash_loading_animations.sh
wget https://raw.githubusercontent.com/Silejonu/bash_loading_animations/main/bash_loading_animations.demo

Run the provided script bash_loading_animations.demo to quickly visualise the available animations.

Add support for loading animations to your script

Put these lines at the top of your script:

# Load in the functions and animations
source /path/to/bash_loading_animations.sh
# Run BLA::stop_loading_animation if the script is interrupted
trap BLA::stop_loading_animation SIGINT

Don't forget to replace /path/to/bash_loading_animations.sh with the appropriate filepath.

Show a loading animation for foo

Show a loading animation for the command foo:

BLA::start_loading_animation "${BLA_name_of_the_animation[@]}"
foo
BLA::stop_loading_animation

If foo prints some output in the terminal, you may want to add:

foo 1> /dev/null # hide standard output
# or
foo 2> /dev/null # hide error messages
# or
foo &> /dev/null # hide all output

Some of the animations have been adapted from https://github.com/sindresorhus/cli-spinners.

bash_loading_animations's People

Contributors

silejonu avatar matthewpersico 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.