Superjulien / Rncaaqc

This shell script is designed to display random ASCII art and a random quote from a file using the neofetch and cowsay commands.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Random Quote and Cow ASCII Art Generator

Version Shell

This is a Bash script that generates a random quote and a randomly selected ASCII art image or a cow image, depending on the user's input. It can display either one or two sets of image and quote, depending on the input arguments.

Usage

The script takes two optional command-line arguments:

$ bash rncaaqc.sh [neofetch|cowsay] [neofetch|cowsay]

The first argument specifies the program to use (neofetch or cowsay). If neofetch is selected, the script will display a randomly selected ASCII art image using the neofetch program. If cowsay is selected, it will display a randomly selected cow image and a quote using the cowsay program.

The second argument is optional and specifies whether to display a second set of image and quote using the same program. If a second argument is provided, the same program must be used as the first argument.

If no arguments are provided, the script will prompt the user to input the desired program (neofetch or cowsay).

The location of the quotations file (quotation.txt) needs to be modified in the script. By default, the script uses the path /Folder/quotation.txt to access the quotations file. Therefore, it is important to modify this value to correspond to the actual location of the file on your system.

To do this, you can edit the script and modify the variable puff to contain the absolute path of the quotation.txt file on your system. For example, if your quotation.txt file is located in your home folder, you can modify the puff variable as follows:

puff=~/quotation.txt

Make sure that the path you specify is correct and that the quotations file is present at that location on your system.

Getting Started

To use this script, follow these steps:

  1. Clone the Repository: Clone this repository to your local machine.

    git clone https://github.com/Superjulien/Rncaaqc.git
  2. Navigate to the Script Directory: Move into the directory containing the script.

    cd path/to/your-repo/Rncaaqc/
  3. Modify the quotation.txt File: Replace the contents of quotation.txt with your desired collection of quotations. Each quotation should be on a new line.

  4. Make the Script Executable: Ensure the script has executable permissions.

    chmod +x rncaaqc.sh
  5. Run the Script: Execute the script using the following command:

    bash rncaaqc.sh cowsay neofetch

Customizing Quotations

To modify the script to use your own quotation.txt file, follow these steps:

  1. Open the Script File: Open the rncaaqc.sh file in a text editor of your choice, such as nano, vim, or even a graphical text editor like Visual Studio Code.

  2. Find the File Path Definition Line: Locate the line where the path to the quotation.txt file is defined. This line looks like this:

    puff=~/Folder/quotation.txt

    Replace ~/Folder/quotation.txt with the absolute path to your own quotation.txt file. For example, if your quotation.txt file is located in the directory /path/to/my/folder, you should have:

    puff=/path/to/my/folder/quotation.txt
  3. Save the File: After making the modifications, save the rncaaqc.sh file.

  4. Run the Script: Now, when you run the script, it will use the quotation.txt file you specified.

Make sure that the quotation.txt file contains a list of quotes, with each quote on a new line. Here's an example of content for your quotation.txt file:

Life is beautiful.
Learning is an endless journey.
Happiness is found in the little things.
Nothing is impossible, will makes everything.

Once you've followed these steps and modified the script according to your needs, you can run the script to generate random quotes from your own quotation.txt file.

Image and Quote Sources

The ASCII art images are stored in an array called neo, and the cow images are stored in an array called cow. Each image is named after the animal or object it depicts and has a .ascii file extension. The images were sourced from various websites and online repositories of ASCII art.

The quotes are stored in a file called quotation.txt. The file contains a list of quotes from various sources, separated by newline characters.

Random Selection of Images and Quotes

The script uses the shuf command to select a random quote from quotation.txt. It then uses the /dev/urandom command to generate random numbers between 0 and 9, which are used to select a random image from the neo or cow array. The selected image is then passed to the selected program (neofetch or cowsay) along with the quote.

Examples

Here are some example commands to run the script:

Display a random cow and quote using cowsay

$ bash rncaaqc.sh cowsay

Display a random ASCII art using neofetch

$ bash rncaaqc.sh neofetch

Display a random cow and quote using cowsay, and then display a random ASCII art using neofetch

$ bash rncaaqc.sh cowsay neofetch

Compatibility

This script should work on most Unix-like operating systems, including Linux and macOS. It requires the cowsay and neofetch programs to be installed.

sudo apt update && sudo apt upgrade -y
sudo apt install cowsay neofetch

Sponsoring

This software is provided to you free of charge, with the hope that if you find it valuable, you'll consider making a donation to a charitable organization of your choice :

  • SPA (Society for the Protection of Animals): The SPA is one of the oldest and most recognized organizations in France for the protection of domestic animals. It provides shelters, veterinary care, and works towards responsible adoption.

    SPA

  • French Popular Aid: This organization aims to fight against poverty and exclusion by providing food aid, clothing, and organizing recreational activities for disadvantaged individuals.

    SPF

  • Doctors Without Borders (MSF): MSF provides emergency medical assistance to populations in danger around the world, particularly in conflict zones and humanitarian crises.

    MSF

  • Restaurants of the Heart : Restaurants of the Heart provides meals, emergency accommodation, and social services to the underprivileged.

    RDC

  • French Red Cross: The Red Cross offers humanitarian aid, emergency relief, first aid training, as well as social and medical activities for vulnerable individuals.

    CRF

Every small gesture matters and contributes to making a real difference.

Support

For support email :

Gmail: superjulien Tutanota: superjulien

Documentation

About

This shell script is designed to display random ASCII art and a random quote from a file using the neofetch and cowsay commands.


Languages

Language:Shell 100.0%