/Stars

⭐ Stars for terminal interfaces ⭐

Primary LanguageC

Unicode stars for terminal interfaces

Stars was primarily a small program that I wrote to compose my setup a couple of months ago. It only took a few minutes to write it that day; however, I rewrote the source code to make it available on my Github.

Features

  • Number of stars is generated based on terminal's dimensions
  • Set a custom number of stars based on terminal's dimensions

Table of contents

Installing the Stars

Running the program

Customization

Installing the Stars

This section contains everything you need to know to compile and run the Stars.

Dependencies

Stars requires the following dependencies to be linked with the executable.

  • Ncurses
  • Anemone

Dowloading the source code

Copy/paste this git command on your terminal to download the source code

git clone --recursive https://github.com/Romulo-Moraes/Stars.git

Setting up Meson build system

The process of setting up the build system is completely done by running the build.sh script on the project root. It will initialize the Meson Build system for the Stars and its dependencies.

If you don't have the Meson on your system, you can get it from here: https://mesonbuild.com/Getting-meson_ptbr.html. Or from your package manager if available.

Compiling the source code

The Meson build handles the entire compilation process of the program. To compile the project, run the following command inside the build/ directory:

meson compile

Compiling the source code and installing the program in your system

If you liked the application and want to make it available across your entire system, run:

# The Meson needs sudo permissions to install the app in your bin directory
sudo meson install

Running the program

After compiling

After compiling the project, the executable will be created in the build/ directory. Assuming that you have just compiled using the Meson build and still in the same directory, run:

./stars

After installing

After installing the project, the Stars app will be available throughout your entire system. To launch the app, run:

stars

Customization

This section will show you everything you need to know to customize the application.

Number of stars

The number of stars is defined based on the terminal's dimensions. By default, a star is created for every 8 terminal cells. You can define how many cells are necessary to create a single star.

To customize the default value, you can pass any ℕ* number using the --proportionality flag:

stars --proportionality 28

The program call above will instruct the Stars to create a new star for every 28 terminal cells.

Note: A single star is not limited by the range of a 28-cell block; it is simply a calculation to determine the maximum number of stars shown on the terminal.

Color

The color of the stars is defined using the flag --color and accepts the following set of colors:

  • black
  • blue
  • cyan
  • green
  • magenta
  • red
  • white
  • yellow
stars --color yellow

Note: the default color is white