Home

Awesome

starfetch

A command line tool written in C++ that displays constellations.

Table of contents


Description

starfetch is a tool that prints out a scheme of a given constellation and some information about it: its quadrant, its right ascension, its declination, ita area and its main stars number.

Demo visuals

ezgif com-gif-maker <img width="1375" alt="1" src="https://user-images.githubusercontent.com/61376940/161760417-8ba116fc-71a6-4d0c-8219-1b76a4121ace.png">

Installation

To install starfetch, run these commands:

MacOS

git clone https://github.com/Haruno19/starfetch
cd starfetch
make
sudo make install_mac

Install directoy: /usr/local/opt/starfetch/.

Others

git clone https://github.com/Haruno19/starfetch
cd starfetch
make
sudo make install

Install directoy: /usr/local/starfetch/.

Usage

starfetch accepts parameters to tweak its behaviour:

starfetch [OPTION] [CONSTELLATION NAME]
    -h      Prints this help message.
    -n      Shows the selected constellation.
    -r      Shows a random constellation.
    -l      Prints the list of all the available constellations.
    
If launched with no arguments, the behaviour is the same as with '-r'.

Examples:   starfetch -r
            starfetch -n orion
            starfetch

Available constellations

orion          gemini
aries          scorpio
cancer         sagittarius
cygnus         aquarius
cassiopeia     ophiuchus
libra          pisces
virgo          antilia
leo            ara
capricorn      apus
taurus         bootes
ursa_major     crux
ursa_minor     corona_borealis
lupus

I will add more and more constellations!

JSON format

All the constellation data is stored as JSON files in the res/constellations/ directory.

Here's a sample of the JSON format from the Orion constellation:

{
    "title": "───── orion ─────",
    "graph":
        {
            "line1": { },
            "line2": { "11": "✦" },
            "line3": { "7": "✦" },
            "line4": { "14": "✦" },
            "line5": { },
            "line6": { "9": "✦", "11": "✦", "13": "✦"},
            "line7": { },
            "line8": { "15": "✦" },
            "line9": { "8": "✦" },
            "line10": { }
        },
    "name": "Orion",
    "quadrant": "NQ1",
    "right ascension": "5h",
    "declination": "+5°",
    "area": "594 sq.deg. (26th)",
    "main stars": "7"
}

Contribution guidelines

If you want to help this project grow by adding constellation files, here are some guidelines to write correct JSON files:

Your help is highly appreciated!

Credits & Dependencies

JSON for Modern C++

To work easly with JSON files, starfetch relies on JSON for Modern C++ by Niels Lohmann.
Although relying on external libraries, no dependencies are needed to install starfetch, since said library is already included in this repository (src/include/json.hpp) via the single_include version provided by the author, in order to make it easier for you, the end user, to enjoy starfetch.

Contributions


All data regarding the constellations is taken from Wikipedia.