Skip to content

🪄 May the wait be something nice. Spinner for bash

Notifications You must be signed in to change notification settings

VictorH028/spix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

spix - CLI Spinner

spix is a command line (CLI) tool written in C++ that displays an animated spinner while a background process is running. It is useful for visually indicating that a task is in progress, especially if the task takes a considerable amount of time.

Install

  • Manual
git clone https://github.com/VictorH028/spix && cd  spix
make build-bin
  • this apt
wget -P $PREFIX/etc/apt/sources.list.d  https://raw.githubusercontent.com/VictorH028/victorh028.github.io/refs/heads/main/key/demon-termux-packages.list
apt update
apt install spix

Usage

Command line:

Usage: spix [options]

Options:
  -h, --help            show this help message and exit
  -t TEXT, --text=TEXT  Text to show
  -i INT, --interval=INT
                        Interval in milliseconds
  -s STRING, --symbols=STRING
                        Symbols the spinner
  -p COMMAND, --process=COMMAND
                        Command to execute
  -l, --list_symbols    List of symbols
  -c COLOR, --color=COLOR
                        Change text color

It also has an integrated manual. man spix

Note

Predefined Symbol

circleHalves: ◐◓◑◒

Example

Show a spinner with custom text:

spix -t "Loading..." -p "sleep 3"

Usage for

_pkgs=("pkg1" "pkg2" "pkg3")
spix -p '$(for package in "${_pkgs[@]}"; do
    echo "pkg install -y $package;"
done)'

Programming

Use as python module:

  • Requirement
pip install pybind11
  • Compilation
make build-python

Example

import spinners
import time

# Create a Spinner object
s = spinners.Spinner()

# Set.textnand)symbols 
s.set_color("blue")
s.set_text("Cargando...")
s.set_symbols("dots")

#Start and stop the spinner
s.start()
time.sleep(5)
s.stop()

Use in C++

#include "spinners.hpp"

int main (int argc, char *argv[]) {
    spinners::Spinner spinner;
    spinner.setColor("red");
    spinner.setText("Loading..");
    spinner.setSymbols("dots");

    spinner.start();
    sleep(5);
    spinner.stop();
    return 0;
}

Note

Project ideas obtained from ora

Contribute

If you would like to contribute to this project, please fork the repository and submit a pull request.

Reference

About

🪄 May the wait be something nice. Spinner for bash

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published