2
5
Fork
You've already forked layfetch
2
*fetch with better layout and parallelism
  • Rust 100%
PerfectlyInternal aa98452df5 bump ver
2026年03月06日 16:32:29 -05:00
config remove default param for network readouts 2026年03月01日 12:36:19 -05:00
src add blank line below ouput 2026年03月06日 16:21:45 -05:00
.gitignore chore: add Cargo.lock 2026年02月28日 20:08:36 +01:00
Cargo.lock bump ver 2026年03月06日 16:32:29 -05:00
Cargo.toml bump ver 2026年03月06日 16:32:29 -05:00
LICENSE Initial commit 2026年02月24日 16:34:14 +01:00
README.md woker default config + readme 2026年02月28日 11:21:56 -05:00
screenshot.png woker default config + readme 2026年02月28日 11:21:56 -05:00

layfetch

*fetch with better layout and parallelism

A screenshot of layfetch displaying some information

Project Goals

  • Use libmacchina to fetch system info
  • Use ratatui to do layout and rendering
  • Flexible layout configuration loaded from a file
    • Dynamically update layout to fit contents
    • Maybe replace JSON with something that's a little less of a pain to write
  • Parallel execution of each fetch, instead of doing them in order like most *fetch do

Completed

  • Loading layout from a file
  • Fetching system info with libmacchina
    • Got it to work in parallel too!
  • Rendering layout with ratatui
    • Dynamically updates when the fetched info is too big
  • Support for shell command readouts
  • Colored logos!

Installation

Run cargo build --release and copy the binary to your PATH. Copy the contents of config to ~/.config/layfetch and edit them to your liking.

Configuration

The layout is a JSON file of nested objects. The following fields in each object control what it does:

  • constraint: The constraint for this object. Set as an object with the following fields:
    • type: The type of constraint. Can be length, percentage, min, max, or fill.
    • value: The value of the constraint. For length, this is the number of characters. For percentage, this is the percentage of the parent object to take up. For min and max, this is the minimum or maximum number of characters to take up. For fill, this is ignored.
  • borders: The borders to draw around this object. Set as an object with the following boolean fields:
    • all: Enables all borders.
    • top
    • bottom
    • left
    • right
  • title: A title to draw at the top of the object, inside the top border. Will allocate space for a top border if drawn without one.
  • margin: The margin to draw around this object. Set as an object with the following fields:
    • horizontal: The horizontal margin in characters.
    • vertical: The vertical margin in characters.
  • readout and params: The readout to display in this object, and parameters for it. For a full list of options, see src/readouts.rs. Some options include:
    • logo: Display a logo. Params:
      • logo: A path to a text file with ASCII art in it. The path is relative to the layout JSON.
      • colors: A path to a JSON file with an array of colors in it. The path is relative to the layout JSON.
    • static: Display a static text field. Params:
      • text: The text to display.
    • shell_cmd: Run shell command and display its output. Params:
      • cmd: The command to run.
  • style: The style to apply to this object. Set as an object with the following fields:
    • fg: The foreground color. Can be a hex code or a named color.
    • bg: The background color. Can be a hex code or a named color.
  • align: The alignment of the content in this object. Can be left, center, or right.
  • direction: The direction the children of this object are laid out in. Can be horizontal or vertical.
  • flex: How to lay out children when there is extra space. Can be start, center, end, space_between or space_around. Defaults to start if not specified. See Ratatui docs for details.
  • children: An array of child objects. The layout will be applied to these children.