A Z Shell (zsh) plugin for managing and customizing 'eza'
'eza' is a very colorful replacement for the venerable 'ls' utility.
While eza needs nothing more than the EZA_COLORS
environment variable to
customize its color configuration, this plugin provides a more complete eza
experience by providing a few extra conveniences, such as:
- an easy to read color configuration file,
- a few sensible aliases, and
- several helpful commands to manage eza
The provided commands are:
configure
default
demo
nocolor
refresh
reset
restore
status
tables
- see eza
- see
man eza
- see
man eza_colors
- see
man eza_colors-explanation
Note: The exit codes used here are based on those found in 'sysexits.h' from
the Standard C Library. See man sysexits.h
for more information.
- zeza
- .zeza::configure
- .zeza::default
- .zeza::demo
- .zeza::nocolor
- .zeza::refresh
- .zeza::reset
- .zeza::restore
- .zeza::status
- .zeza::tables
the main zeza command
zeza - launches user-facing commands to manage the eza configuration
usage: zeza COMMAND [OPTIONS]
zeza restore . /home/config/backup/.zeza_config.eza
-
-h | --help
display help text and exit
-
-v | --version
display the plugin version and supported
eza
version
- $1 (string): COMMAND - the command to run
- ... (string): ARGS - arguments and/or options for the COMMAND
- 0: if successful
- 64: wrong number of arguments
- 69: invalid command, or command not available
- help text if -h or --help options were provided
- error message and/or help text
commands providing user-facing functionality for zeza
configure - copies the default eza configuration file to the user's home directory, or to a location of their choosing
usage: zeza configure [OPTION] | [DESTINATION]
zeza configure /home/user/config/location
-
-h | --help
display help text and exit
- $1 (path): DESTINATION - the location where the configuration file will be stored
- 0: if successful or cancelled
- 66: if color settings and EZA_COLORS fail to load properly
- 73: if configuration file copy failed
- 77: if DESTINATION cannot be created or is not writable
- user responses to various prompts
- information regarding the configuration process
- various error messages depending on the error
default - setup eza to use the default, builtin color configuration
Any user configuration file in use will be backed up to the cache directory
and can be restored using zeza restore
usage: zeza default [OPTION]
zeza default
-
-h | --help
display help text and exit
Function has no arguments.
- EZA_COLORS (string): the environment variable used by eza for colored output generation
- 0: if successful
- 66: if color settings and EZA_COLORS fail to load properly
- 73: if an error occured while backing up the user configuration file
- user response to a confirmation prompt
- information regarding the process of setting default mode and the zeza environment status
- various error messages depending on the error
demo - print eza color codes and their descriptions in their currently assigned colors
usage: zeza demo [OPTION]
zeza demo
-
-h | --help
display help text and exit
Function has no arguments.
- 0: if successful
- 66: if temporary demo file cannot be read
- 73: if temporary demo file cannot be created
- 78: if EZA_COLORS is not set
- all eza color codes and custom extensions printed in their corresponding colors based on the current configuration
- various error messages depending on where in the function the error occurred
nocolor - setup eza to display completely colorless output
Disables all color output from eza by prepending the reset
code to EZA_COLORS
and setting all color codes to 00. Any user configuration file in use will be
backed up to the cache directory and can be restored using zeza restore
Note: running this command is NOT the same as setting the 'NO_COLOR' environment variable as described in the eza man pages.
usage: zeza nocolor [OPTION]
zeza nocolor
-
-h | --help
display help text and exit
Function has no arguments.
- EZA_COLORS (string): the environment variable used by eza for colored output generation
- 0: if successful
- 73: if an error occured while backing up the user configuration file
- user response to a confirmation prompt
- information regarding the process of setting no color mode and the zeza environment status
- various error messages depending on the error
refresh - refresh zeza to reflect changes made to a configuration file
usage: zeza refresh [OPTION]
zeza refresh --demo
-
-h | --help
display help text and exit
-
-d | --demo
display demo output after refresh
Function has no arguments.
- EZA_COLORS (string): the environment variable used by eza for colored output generation
- 0: if successful
- 64: if executed while in 'default or 'no color' mode
- 66: if color settings and EZA_COLORS fail to load properly
- function status updates and the zeza demo if the --demo option was provided
- various error messages depending on the error
reset - prepends the 'reset' flag to the EZA_COLORS environment variable
This disables eza's color assignments for standard file extensions.
usage: zeza reset [OPTION]
zeza reset
zeza reset -u
-
-h | --help
display help text and exit
-
-u | --unset
remove the reset flag from EZA_COLORS
Function has no arguments.
- EZA_COLORS (string): the environment variable used by eza for colored output generation
- 0: if successful or cancelled
- 69: if reset flag is already set
- 73: if an error occured while backing up the user configuration file
- user response to a confirmation prompt
- information regarding the process of setting the 'reset' flag and zeza status
- various error messages depending on the error
restore - restores a previous eza color configuration from a source file
If no source file is provided, restore will default to using a cached backup
usage: zeza restore DESTINATION [SOURCE=cached backup]
zeza restore /home/user /home/user/backup/.zeza_config.eza
- $1 (path): DESTINATION - the full path to where the configuration will be restored
- $2 (path): SOURCE - the full path to a configuration file (defaults to cached backup)
- 0: if successful
- 64: if DESTINATION is not provided
- 66: if SOURCE is not readable or cached backup is missing
- 73: if DESTINATION cannot be created
- 77: if ESTINATION is not writable
- user responses to various prompts
- information regarding the configuration process
- various error messages depending on where in the function the error occurred
status - show the current status of the zeza plugin environment
usage: zeza status [OPTION]
zeza status
-
-h | --help
display help text and exit
Function has no arguments.
- 0: if successful
- 1: on error
- prints the following information:
- eza program version
- set/unset status of the EZA_COLORS environment variable
- current color mode
- reset status
- current configuration file path
- cached backup status
tables - display one or more color tables representing the color capabilities of the user's terminal emulator
usage: zeza tables [OPTION]
zeza tables
zeza tables --bn
zeza tables --all
zeza tables --test
-
-h | --help
display help text and exit
-
-n
display the normal on normal color table (default)
-
-b
display the bright on bright color table
-
--nb
display the normal on bright color table
-
--bn
display the bright on normal color table
-
--256
display the 256 color table
-
-a | --all
display all table variations
-
-t | --test
test if bold text is displayed using bright colors
Function has no arguments.
- 0: if successful
- 64: if an invalid option is provided
- displays the following:
- one or more color tables depending on the option provided
- a bold/bright color terminal emulator test and information