Skip to content

A light, opinionated, responsive, theme-able, and simple Text User Interface (TUI) file manager for Linux and macOS

License

Notifications You must be signed in to change notification settings

andornaut/filectrl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileCTRL

FileCTRL is a light, opinionated, responsive, theme-able, and simple Text User Interface (TUI) file manager for Linux and macOS

image

Installation

  1. git clone and cd into this repository
  2. Run cargo build --release && sudo cp target/release/filectrl /usr/local/bin/

Usage

Run filectrl --help to view the available command line arguments and options:

Usage: filectrl [<directory>] [-c <config>] [--write-config]

FileCTRL is a light, opinionated, responsive, theme-able, and simple
Text User Interface (TUI) file manager for Linux and macOS

Positional Arguments:
  directory         path to a directory to navigate to

Options:
  -c, --config      path to a configuration file
  --write-config    write the default config to ~/.config/filectrl/config.toml,
                    then exit
  --help            display usage information

Keyboard controls

Normal mode

Keys Description
q Quit
j / k Move selection down / Up
Backspace, Left, b, h Navigate to the parent directory
Enter, Right, f, l Open the selected file or navigate to the selected directory
CTRL+f, CTRL+d PgDn Move selection and scroll down one page
CTRL+b, CTRL+u, PgUp Move selection and scroll up one page
Home, ^ Select the first item
End, $ Select the last item
Delete Delete the selected file or directory
r, F2 Rename the selected file or directory
CTRL+r, F5 Refresh
n Sort by name (toggle direction if already sorted)
m Sort by modified (toggle direction if already sorted)
s Sort by size (toggle direction if already sorted)
e Clear error messages
p Clear progress bar
? Toggle help

Filtered mode

Keys Description
Esc Exit filtered mode

Input mode

Keys Description
Esc Exit input mode
Enter Submit your input and exit input mode

Configuration

The configuration is drawn from the first of the following:

  1. The path specified by the command line option: --config-path
  2. The default path, if it exists: ~/.config/filectrl/config.toml
  3. The built-in default configuration

Run filectrl --write-config to write the default configuration to ~/.config/filectrl/config.toml.

Opening in other applications

Keyboard key Description
f Open the selected file using the default application configured in your environment
o Open the selected file using the program configured by: open_selected_file_template
t Open the current directory in the program configured by: open_current_directory_template
w Open a new filectrl window in the terminal configured by: open_new_window_template
# %s will be replaced by the current directory path:
open_current_directory_template = "alacritty --working-directory %s"
# %s will be replaced by the selected file or directory path:
open_selected_file_template = "pcmanfm %s"

Theming

All colors can be changed by editing the configuration file:

filectrl --write-config
vim ~/.config/filectrl/config.toml

You can see all of the available theme variables in the default configuration.

Desktop entry

You can make filectrl the default application for opening directories. Start by copying the filectrl.desktop file to ~/.local/share/applications/:

cp filectrl.desktop ~/.local/share/applications/
xdg-mime default filectrl.desktop inode/directory
update-desktop-database ~/.local/share/applications/

Developing

cargo clippy
cargo fix --allow-dirty --allow-staged
cargo test
cargo run
cargo build --release
./target/debug/filectrl

# Log to ./err
RUST_LOG=debug cargo run 2>err

Git hooks

Changing cargo-husky configuration:

  1. Edit the [dev-dependencies.cargo-husky] section of Cargo.toml
  2. rm .git/hooks/pre-commit (or other hook file)
  3. cargo clean
  4. cargo test
  5. Verify that the changes have been applied to .git/hooks/pre-commit

About

A light, opinionated, responsive, theme-able, and simple Text User Interface (TUI) file manager for Linux and macOS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages