A little Rust program that greets you with a selection of quotes.
-
First of all, clone the git repo into your machine (
git clone git@github.com:Alejandro-Villa/CLI-Greeter.git), if you don't have git you can download it from your distro repositories. More info about git here. -
Then,
cdinto the folder and run:
cargo build --release
cargo run quotes/famous-people --releaseThat should build and run the program with a pre-supplied example file.
If you want this script to greet you when you open your CLI, you need to add it to your .bashrc (or equivalent). It'll run every time you start your terminal and choose a random quote and display it centered on the screen.
Example:
# Other lines...
# CLI-Greeter
~/path-to-folder/target/release/cli-greeter ~/path-to-folder/quotes/famous-peopleIf you want to run it with a custom file, just give its route as an argument.
- All quotes must end with a newline character.
- The text of the quote must be enclosed in double quotes (").
- The author is supplied right after the closing quote and up to the end of the line.
I have included in .gitignore the file quotes/personal. You can put your personalized collection of quotes there, remember to follow the correct format specified above.
- DONE Make it so you can change the quoutes without editing the code (preferably with a plain text file next to the script).
- DONE Make it so it doesn't split up words.
- Not needed anymore Make it compatible with Shell (not only bash).
- Add meaningful errors and a integrated help.
This work is licensed with GPLv3.0. See the license for more information.
You can contact me through GitHub or at awewanwo@disroot.org. I'm happy to answer any questions
There is an older version written in bash. It has suffered some minor changes in the quote format. You may find it in this repo history.