Skip to content

MuntasirSZN/getquotes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

468 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

๐Ÿ“œ getquotes

Fetch Inspirational Quotes from the Command Line ๐Ÿš€

License GitHub issues GitHub stars Last commit Repo size GitHub Release

getquotes is a powerful command-line tool written in Rust that fetches and displays inspirational quotes directly from Wikiquote. Whether you're looking for motivation, wisdom, or just a quick pick-me-up, GetQuotes has got you covered. ๐ŸŒŸ

๐Ÿ“– Table of contents


๐Ÿš€ Features

  • Fetch Quotes: Get random quotes from Wikiquote. ๐Ÿ“œ
  • Custom Authors: Specify authors to fetch quotes from. ๐Ÿ–‹๏ธ
  • Rainbow Mode: Display quotes with a real rainbow gradient. ๐ŸŒˆ
  • Offline Mode: Use cached quotes when offline. ๐Ÿ“ด
  • Configurable: Customize colors, gradients, text styles, layout, log file, and more via a TOML configuration file. ๐Ÿ› ๏ธ
  • Lightweight: Fast and efficient, written in Rust. โšก

๐Ÿ“ฅ Installation

Repository Command To Install Version
Crates.io cargo install getquotes Crates.io
AUR yay -S getquotes AUR
AUR (Git) yay -S getquotes-git AUR
Homebrew brew install MuntasirSZN/programs/getquotes Homebrew

Note

You can install getquotes from the AUR using yay or paru, or any other AUR helper.

Manual Installation

You can clone the repository and build it from source:

git clone https://github.com/MuntasirSZN/getquotes.git
cd getquotes
cargo build --release

Then, copy the binary to your PATH:

cp target/release/getquotes /usr/local/bin

Manpages are included in the repository and can be installed using:

sudo cp man/getquotes.1 /usr/share/man/man1
sudo mandb # To update the manpage database

If you are on windows, you can use the ps1xml file, which is a like a manpage for windows powershell. Use the Get-Help command to view the manpage.

copy .\man\getquotes.ps1xml $env:PSModulePath\getquotes.ps1xml
Get-Help getquotes

Important

If you are building for android from source, you need the Android NDK installed and the ANDROID_NDK_HOME environment variable set to the NDK path.


๐Ÿงญ Configuration

getquotes can be configured using a TOML configuration file. The configuration file schema is generated from Rust types with schemars and written to config/config.schema.json. You can use this schema in editors powered by Taplo or Tombi. Add this at the top of your config file:

#:schema https://raw.githubusercontent.com/MuntasirSZN/getquotes/refs/heads/main/config/config.schema.json

Here's an example of a configuration file:

# List of authors to fetch quotes from
authors = [
    "Albert Einstein",
    "Isaac Newton"
]

# Theme color supports hex, rgb/rgba, hsl, or CSS-inspired gradients
theme_color = "conic-gradient(from 90deg, #FF5733, hsl(45, 100%, 50%), rgb(0, 170, 255))"

# Extra styling for the quote text
quote_style = "bold"

# Styling for the author line
author_style = "italic,green"

# Optional styling for nested quotes inside the quote text
nested_quote_style = "underline"

# Maximum number of attempts to fetch a quote
max_tries = 50

# Log file path
log_file = "custom_getquotes.log"

# Enable rainbow mode for a true rainbow gradient
rainbow_mode = false

# Output layout: "default" or "box"
layout = "default"

# Box corner style when layout = "box": "pointy" or "rounded"
box_corners = "pointy"

Properties

  • authors: An array of author names to fetch quotes from. At least one author must be specified.
  • theme_color: The base quote color. Supports hex, rgb(...), rgba(...), hsl(...), and CSS-inspired gradient functions such as linear-gradient(...), radial-gradient(...), conic-gradient(...), and repeating variants.
  • quote_style: Comma-separated quote styling tokens such as bold, italic, underline, strikethrough, colors, or gradients.
  • author_style: Comma-separated styling tokens for the author line.
  • nested_quote_style: Optional styling applied to quotes found inside the main quote text.
  • max_tries: The maximum number of attempts to find a quote (between 1 and 100, default is 30).
  • log_file: The path to the log file (default is "getquotes.log").
  • rainbow_mode: Overrides the quote color with a rainbow gradient.
  • layout: default keeps the current layout, while box renders the quote and author inside a box.
  • box_corners: Chooses pointy (+, |, -) or rounded (โ•ญ, โ•ฎ, โ•ฐ, โ•ฏ, โ”‚, โ”€) corners for box layout.

๐Ÿ’ก Usage

A simple cli tool to get quotes in your terminal using WikiQuotes

Usage: getquotes [OPTIONS]

Options:
  -a, --authors <AUTHORS>          Specify a list of authors to fetch quotes from
  -t, --theme-color <THEME_COLOR>  Set the theme color for the displayed quotes
  -m, --max-tries <MAX_TRIES>      Set the maximum number of tries to fetch a quote
  -l, --log-file <LOG_FILE>        Specify the log file path
  -r, --rainbow-mode [<RAINBOW_MODE>]
                                  Enable rainbow mode for gradient rainbow quote colors
  -i, --init-cache                 Initialize the quote cache for offline mode
  -o, --offline                    Run in offline mode, using cached quotes
  -v, --version                    Print version information
  -C, --config <CONFIG>            Use a custom TOML configuration file
  -c, --completion <COMPLETION>    Generate shell completion script [possible values: bash, elvish, fish, powershell, zsh, nushell]
  -h, --help                       Print help

MuntasirSZN <muntasir.joypurhat@gmail.com>

๐Ÿค Contributing

We welcome contributions from the community! If you'd like to contribute, please follow these steps:

  1. Fork the repository. ๐Ÿด
  2. Create a new branch. ๐ŸŒฟ
  3. Make your changes. โœ๏ธ
  4. Submit a pull request. ๐Ÿš€

Please make sure to follow our Code of Conduct and Contribution Guidelines.

Configuration Schema

The configuration schema file is config/config.schema.json, generated from Config via schemars. If you change configuration fields, run:

cargo run --bin generate_config_schema

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • Wikiquote: For providing the quotes. ๐Ÿ“–
  • Rust Community: For the amazing ecosystem and tools. ๐Ÿฆ€
  • Inspiration: This project was inspired by the need for a simple, daily dose of inspiration. ๐ŸŒŸ

๐ŸŒŸ Show Your Support

If you find this project useful, please give it a โญ๏ธ on GitHub!

About

A simple cli tool to get quotes in your terminal using WikiQuotes

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors