BATPIPE(1)
๐ฆ batpipe(1) โ General Commands Manual ๐ฆ
okay so welcome to the batpipe(1) glow-up, bestie ๐ this is the manual page that explains the whole vibe: batpipe is a less (and bat) preprocessor situation, and it's genuinely iconic for peeking at way more file types in your terminal. iykyk ๐
โจ NAME โจ
batpipeโ Aless(andbat) preprocessor for viewing more types of files in the terminal. periodt ๐
๐ธ DESCRIPTION ๐ธ
no extra description text here in the original โ the deets are all in the sections below, and they ate โจ
๐ USAGE ๐
Like lesspipe, batpipe is designed to work with programs that support preprocessing with the LESSOPEN environment variable. Setting up batpipe will depend on your shell:
Bash:
eval "$(batpipe)"
Fish:
eval (batpipe)
๐ ENVIRONMENT ๐
one variable, one job, periodt:
BATPIPE_TERM_WIDTHโ Sets the terminal width provided tobat. If this variable starts with a hyphen (-), the number provided will be relative to the detected terminal size.
๐ง BUILT-IN VIEWERS ๐ง
these are the file types batpipe already handles by default, no cap:
- Directories โ
eza,ls .tar,.tar.gzโtar.zip,.jarโunzip.gzโgunzip.xzโxz
๐ฆ EXTERNAL VIEWERS ๐ฆ
For file formats that aren't supported by default, an external file viewer can be added to batpipe through the external viewer API.
External viewers get added to batpipe by creating bash scripts inside the ~/.config/batpipe/viewers.d/ directory.
๐ Creating Viewers ๐
Viewers must define two functions and append the viewer's name to the $BATPIPE_VIEWERS array.
viewer_${viewer}_supports [file_basename] [file_path] [inner_file_path]viewer_${viewer}_process [file_path] [inner_file_path]
The viewer_${viewer}_supports function is called to determine if the external viewer is capable of viewing the provided file. If this function returns successfully, the corresponding process function will be called.
๐ฎ API ๐ฎ
$BATPIPE_VIEWERSโ An array of loaded file viewers.$BATPIPE_ENABLE_COLORโ Whether color is supported. (true|false)$BATPIPE_INSIDE_LESSโ Whetherbatpipeis insideless. (true|false)batpipe_header [pattern] [...]โ Print a viewer header line.batpipe_subheader [pattern] [...]โ Print a viewer subheader line.strip_trailing_slashes [path]โ Strips trailing slashes from a path.
๐ CAVEATS ๐
caveat time, bestie โ don't skip this one ๐
- By default,
batpipewill not use colors when previewed insideless. Colors must be explicitly enabled withBATPIPE=color.
xoxo, BATPIPE(1) ๐
โ General Commands Manual (the footer is literally just BATPIPE(1), bestie โ no date or version to spill, and I'm not making one up) ๐ซถ
๐ฆ where this page comes from
- arch rolling: bat-extras 2024.08.24-1 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms