📚 flow state reading in the terminal

Last update: Jun 22, 2022

fsrx

📚 (f)low (s)tate (r)eading e(x)change – flow state reading in the terminal

GitHub CI Workflow GitHub Deploy Workflow License Crate Version Github Stars

demo

Inspired by (but not affiliated with) Renato Casutt and his revolutionary work on Bionic Reading.

Usage

For detailed usage run fsrx -h.

fsrx 1.0.1
Colby Thomas <[email protected]>
📚(f)low (s)tate (r)eading e(x)change
flow state reading in the terminal

USAGE:
    fsrx [OPTIONS] [PATH]

ARGS:
    <PATH>    path to file (or supply input via stdin)

OPTIONS:
    -c, --contrast               high contrast
    -f, --fixation <FIXATION>    fixation intensity [default: m] [possible values: l, m, h]
    -h, --help                   Print help information
    -s, --saccade <SACCADE>      saccade intensity [default: h] [possible values: l, m, h]
    -V, --version                Print version information

Examples

$ echo "the quick brown fox jumps over the lazy dog" | fsrx
$ fsrx input.txt | less
$ fmt -w60 input.txt | fsrx -c -fh -sl

Installation

Cargo

$ cargo install fsrx

Homebrew

incoming @ homebrew-fsrx

Arch Linux

fsrx via the AUR

NetBSD

fsrx from the official repositories

Contributing

All contributions are greatly appreciated. Please keep in mind this project is meant to be as lightweight as possible, so not every idea will be considered.

If you have a suggestion that would make fsrx better, please fork the repo and create a pull request. You can also simply open an issue and select Feature Request

  1. Fork the repo
  2. Create your feature branch (git checkout -b [your_username]/xyz)
  3. Commit your changes (git commit -m 'add some xyz')
  4. Rebase off main (git fetch --all && git rebase origin/main)
  5. Push to your branch (git push origin [your_username]/xyz)
  6. Fill out pull request template

See the open issues for a full list of proposed features (and known issues).

License

Distributed under the MIT License. See LICENSE.md for more information.

Follow

github twitter youtube

GitHub

https://github.com/thatvegandev/fsrx
Comments
  • 1. AUR Package

    Hello,

    I started using the project (thank you!) and also packaged it to Arch User Repository

    Arch Linux user can simply;

    paru -S fsrx-git
    

    Or using any other AUR helper they use. This can be added to the README.md if you'd like.

    The -git tag (sorry if you already know this) says that the package tracks this repository directly. AUR Submission Guidelines says that the fsrx package can be submitted to AUR when there's an official release on upstream (here). On a potential fsrx, the AUR package will download the release .tar.gz (instead of cloning the repository) and build the package using that.

    Currently the repository is using prereleases, if you'd like you can start releasing full releases (feedback: as far as I can tell the program is stable and ready for use) and that can be packaged as well

    Cheers

    Reviewed by yigitsever at 2022-06-08 10:24
  • 2. Newlines stripped when reading STDIN

    Description

    When the file is provided as an argument, the newlines are handled correctly. But when fsrx reads from standard input the newlines are stripped away.

    To Reproduce

    $ fsrx .bashrc # as expected
    $ cat .bashrc | fsrx # a mess
    

    Expected behavior

    The newline handling should be consistent between those two methods.

    Screenshots

    screenshot_54628065

    Additional context

    Fixing this would make it possible to use fmt to reflow incoming text to a managable width, like so:

    $ fmt -w 60 long_lines.txt | fsrx | less -R
    

    Right now the newlines created by fmt are deleted.

    Reviewed by piotr-machura at 2022-06-07 18:58
  • 3. Requesting documentation for some suggested compatible color settings

    Problem

    Some terminal themes slightly or greatly obscure the effect.

    Hoping to request guidance at least for which settings could help replicate the awesome readme image : )

    Solution

    Examples of color settings, possibly hex codes for font, bold-font, and background for reproducing the readme image.

    Reviewed by gkielian at 2022-06-08 21:12
  • 4. Nix Package

    Hey, first of all I wanted to thank you for this awesome application. Secondly, I just wanted to let you know that I recently packaged fsrx for nix. Perhaps you could add a small note to the README, so other nix users could know that it is packaged and ready to go.

    Reviewed by MoritzBoehme at 2022-06-13 15:31
  • 5. Unicode-based split of words and graphemes

    What:

    • Inputs with non-latin alphabets are now processed correctly.

    Why:

    • The original regex [\w\\']+ only matches latin alphabets, thus non-latin inputs were not processed at all.
    • The &str.len() is not always the same as the length of the Unicode graphemes, and indices in style_substr were calculated wrongly for multibyte characters.

    How:

    • Changed the word-split algorithm from regex to unicode_word_indices
    • Changed the character indexing from &str slice to UnicodeSegmentation::graphemes

    Tests:

    • English echo 'The Quick Brown Fox Jumps Over The Lazy Dog' | fsrx
    • French echo "Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en canoë au-delà des îles, près du mälström où brûlent les novæ" | fsrx
    • Korean echo '키스의 고유 조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다.' | fsrx

    Checklist:

    • [x] Allow edits from maintainers option checked
    • [x] Branch name is prefixed with [your_username]/ (ex. coloradocolby/featureX)
    • [x] Documentation added
    • [x] Tests added
    • [x] No failing actions
    • [x] Merge ready

    Caveat:

    • I comfirmed that languages putting spaces between words are processed quite similarly to English. However, it seems that fsrx's algorithm (and Bionic Reading) cannot be applicable to some Asian languages that do not use spaces (such as Japanese and Chinese.)
    • Some terminal emulators (e.g., Alacritty, if I remember correctly) may not properly support Unicode input / output. I tested my code with xfce4-terminal.
    • For non-latin alphabets, I tested my code with D2Coding font, but other fonts such as Noto will work as well.
    Reviewed by ichianr at 2022-06-09 08:33
Rust crate `needleman_wunsch` of the `fasebare` package: reading FASTA sequences, Needleman-Wunsch alignment

fasebare Rust crate needleman_wunsch of the fasebare package: reading FASTA sequences, Needleman-Wunsch alignment. Synopsis The crate needleman_wunsch

Nov 19, 2021
Run your Rust CLI programs as state machines with persistence and recovery abilities

step-machine Run your CLI programs as state machines with persistence and recovery abilities. When such a program breaks you'll have opportunity to ch

Jan 9, 2022
This is the data collector that gets your system's state and sends it to the backend
This is the data collector that gets your system's state and sends it to the backend

⚡ Installation Linux curl -s https://raw.githubusercontent.com/xornet-cloud/Reporter/main/scripts/install.sh | sudo bash Windows Invoke-Command -Scrip

May 1, 2022
global state management for dioxus built on the concept of atoms. currently under 🏗

Fermi: A global state management solution for Dioxus, inspired by Recoil.Js Fermi provides primitives for managing global state in Dioxus applications

Feb 12, 2022
Alexander Mongus is a state-of-the-art filter to sneak amogus characters in pictures
Alexander Mongus is a state-of-the-art filter to sneak amogus characters in pictures

A. Mongus Go to: http://www.lortex.org/amogu/ ??? This is a client-side, Webassembly-based filter to hide amongus characters in your images. Example:

Apr 16, 2022
:large_orange_diamond: Build beautiful terminal tables with automatic content wrapping
:large_orange_diamond: Build beautiful terminal tables with automatic content wrapping

Comfy-table Comfy-table tries to provide utility for building beautiful tables, while being easy to use. Features: Dynamic arrangement of content to a

Jun 20, 2022
🛎 60+ Elegant terminal spinners for Rust

Spinners - ?? 60+ Elegant terminal spinners for Rust ❤️ Shameless plug Charts, simple as a URL. No more server-side rendering pain, 1 url = 1 chart Lo

Jun 20, 2022
Low-level Rust library for implementing terminal command line interface, like in embedded systems.

Terminal CLI Need to build an interactive command prompt, with commands, properties and with full autocomplete? This is for you. Example, output only

May 8, 2022
Rust library for ANSI terminal colours and styles (bold, underline)

rust-ansi-term This is a library for controlling colours and formatting, such as red bold text or blue underlined text, on ANSI terminals. View the Ru

Jun 15, 2022
Cross-platform Rust library for coloring and formatting terminal output
Cross-platform Rust library for coloring and formatting terminal output

Coloring terminal output Documentation term-painter is a cross-platform (i.e. also non-ANSI terminals) Rust library for coloring and formatting termin

Jun 6, 2022
create and test the style and formatting of text in your terminal applications
 create and test the style and formatting of text in your terminal applications

description: create and test the style and formatting of text in your terminal applications docs: https://docs.rs/termstyle termstyle is a library tha

Jul 3, 2021
A dead simple ANSI terminal color painting library for Rust.

yansi A dead simple ANSI terminal color painting library for Rust. use yansi::Paint; print!("{} light, {} light!", Paint::green("Green"), Paint::red(

Jun 16, 2022
(Rust) Coloring terminal so simple you already know how to do it !

Colored Coloring terminal so simple, you already know how to do it! "this is blue".blue(); "this is red".red(); "this is red on blue".red(

Jun 24, 2022
Cross platform terminal library rust
Cross platform terminal library rust

Cross-platform Terminal Manipulation Library Crossterm is a pure-rust, terminal manipulation library that makes it possible to write cross-platform te

Jun 24, 2022
Build terminal user interfaces and dashboards using Rust
Build terminal user interfaces and dashboards using Rust

tui-rs tui-rs is a Rust library to build rich terminal user interfaces and dashboards. It is heavily inspired by the Javascript library blessed-contri

Jun 23, 2022
Currency exchange rates in your terminal

Usage example Rates is a scriptable CLI tool that brings currency exchange rates right into your terminal and supports 30+ fiat and 10K+ crypto currencies.

May 24, 2022
My terminal emulator
My terminal emulator

Miro A GPU-accelerated terminal emulator written in Rust. miro -t pika miro -t kirby miro -t mario miro -t sonic Building from source

May 31, 2022
Alacritty - A fast, cross-platform, OpenGL terminal emulator
Alacritty - A fast, cross-platform, OpenGL terminal emulator

Alacritty is a modern terminal emulator that comes with sensible defaults, but allows for extensive configuration. By integrating with other applications, rather than reimplementing their functionality, it manages to provide a flexible set of features with high performance. The supported platforms currently consist of BSD, Linux, macOS and Windows.

Jun 17, 2022
Terminal-based typing test.
Terminal-based typing test.

ttyper Ttyper is a terminal-based typing test built with Rust and tui-rs. installation With Cargo: cargo install ttyper usage For usage instructions,

Jun 20, 2022