Skip to content

deciduously/file_utility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

file_utility

A simple TUI file utility. This program is only designed to run and compile on 64-bit Linux.

screenshot

Usage

  1. Download or otherwise obtain the compiled executable.
  2. Make it executable: $ chmod +x file_utility.
  3. Place it somewhere in your PATH: e.g. $ mv file_utility $HOME/bin.
  4. Navigate to the directory where you'd like the program to start: e.g. $ cd ~.
  5. Execute the program: file_utility.

You can use the Esc key to abort text-input mode.

If you don't see the Usage panel at the bottom, try resizing your terminal window. It usually just works but if that seems to fix it if not.

I've only tested this on Fedora 34 and Debian 10, but it is fully statically linked and I would expect it to work on many other 64-bit Linux systems.

Development

This program is implemented in Rust, using a handful of dependencies found on crates.io.

Requirements

  • Stable Rust: The default stable toolchain is fine. Obtainable via rustup using the instructions at this link.
  • x86_64-unknown-linux-musl target: Once rustup is installed and ready to use, execute rustup target add x86_64-unknown-linux-musl. Alternatively, you could delete or rename the .cargo/config.toml which forces this target. This program should also build for the default Linux target and run fine on your machine. To ensure this binary is as portable as possible, this repository is configured to always compile for this alternate target. In default builds, Rust statically links all your dependencies but still dynamically links to the system libc, which means incompatible versions may prevent the executable from running. Using this alternate libc allows even this to be statically linked, removing the runtime dependency on a minimum installed version.

Build

Clone or download this repository. Enter the project directory containing Cargo.toml and execute cargo run to compile and execute the program. The resulting executable will be located at target/x86_64-unknown-linux-musl/debug/file_utility. To compile with release mode, add the --release flag. Use cargo build to build the binary without running it. Use cargo test to run tests.

Crates

  • anyhow - Ergonomic error handling
  • chrono - Date and time handling
  • libc - FFI bindings to libc
  • termion - Low-level terminal interface (like ncurses but not)
  • tui-rs - Widget-based terminal user interface library
  • unicode-width - Unicode string width on screen