GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - alexcoder04/shclrz: Colored output in the shell made simple

BranchesTags
Open more actions menu

Latest commit

 

History

40 Commits
40 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
release.sh
release.sh
 
 
shclrz
shclrz
 
 
shclrz.1
shclrz.1
 
 

Repository files navigation

shclrz - shell colorizer

Note: There is a more heavy version of this project with more features written in Go. Check it out: alexcoder04/golored.

shclrz (as in SHell CoLoRiZer) is a simple shell script with the goal to simplify creating colored output in the shell. You don't need to remember the ANSI escape sequences anymore, you can just pipe your text into shclrz and the output will be colored.

Usage

As standalone program

shclrz [OPTIONS]
option alternative function
-h --help print help
-v --version print program version
-i --info print color codes
-s SOURCE_FILE --source-file SOURCE_FILE read from file
-f COLOR --foreground COLOR specify foreground color
-b COLOR --background COLOR specify background color
-F FORMATTING --formatting OPTION specify formatting option

Examples:

shclrz -f red -F underline <file.txt

Outputs the content of file.txt underlined and with red foreground.

ls | shclrz -b blue

Colors the output of ls with blue background.

List of colors:

black, blue, red, magenta, green, cyan, yellow, white

List of formatting options:

bold, dim, italic, underline

As a shell library

You can also source shclrz. In that case, it will define a colorize function, into which you can pipe text which then will be colored. You can control the formatting with following variables: $SHCLRZ_FOREGOUND, $SHCLRZ_BACKGROUND, $SHCLRZ_FORMATTING. These variables have to be set to the number of the color/options; these numbers are available in shclrz --info.

Also, it defines variables for all the colors and formatting options. Example:

source shclrz

# red foreground
echo -e "${FG_RED}Hello World${RESET}" # -e flag is only necessary for Bash, not for POSIX shells
# blue background
echo -e "${BG_BLUE}Hello World${RESET}"
# bold text
echo -e "${FRM_BOLD}Hello World${RESET}"

List of variables

FG_BLACK, FG_RED, FG_GREEN, FG_YELLOW, FG_BLUE, FG_MAGENTA, FG_CYAN, FG_WHITE

BG_BLACK, BG_RED, BG_GREEN, BG_YELLOW, BG_BLUE, BG_MAGENTA, BG_CYAN, BG_WHITE

FRM_BOLD, FRM_DIM, FRM_ITALIC, FRM_UNDERLINE

RESET

Installation

Arch and Arch-based distros

This project is available on the AUR as shclrz. Either install it manually or use an AUR helper of your choice.

Other distros

  1. Download the latest version of shclrz from the releases page.
  2. tar xf shclrz-*.tar.gz
  3. sudo make install

Uninstallation

On Arch-based distros:

sudo pacman -R shclrz`

On other distros:

sudo rm -rfv /usr/bin/shclrz /usr/share/doc/shclrz /usr/share/licenses/shclrz /usr/share/man/man1/shclrz.1

How do I pronounce shclrz?

Finally we have a program that is more difficult to pronounce as sxhkd! However just say "shell colorizer", that's easier...

About

Colored output in the shell made simple

Topics

bashclicolorcolorizationcolorscommand-linelinuxshellshell-scriptterminalutility

Resources

Readme
GPL-3.0 license
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.