FileCtrl is a light, opinionated, responsive, theme-able, and simple Text User Interface (TUI) file manager for Linux and macOS
You can download and install a pre-built binary for Linux or macOS:
curl -sL https://github.com/andornaut/filectrl/releases/download/main/filectrl-linux -o filectrl
chmod +x filectrl
sudo mv filectrl /usr/local/bin/On macOS, allow the unsigned filectrl binary to be executed:
xattr -d com.apple.quarantine filectrlgit cloneandcdinto this repository- Run
cargo build --release && sudo cp target/release/filectrl /usr/local/bin/
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
When you copy/cut a file or directory, FileCtrl puts ${operation} ${path} into your clipboard buffer
(where operation is "cp" or "mv").
If you then paste into a second FileCtrl window, this second instance of FileCtrl will perform the equivalent of:
${operation} ${path} ${current_directory}, e.g. cp filectrl.desktop ~/.local/share/applications/.
Under the hood, FileCtrl doesn't actually invoke cp or mv, but implements similar operations using the Rust standard library.
Normal mode
| Keys | Description |
|---|---|
| q | Quit |
| ← / h, ↓ / j, ↑ / k, → / l | Navigate left, down, up, right |
| ~ | Go to home directory |
| ← / b / Backspace | Go to parent directory |
| → / f / l / Enter / Space | Open the selected file using the default application configured in your environment, or navigate to the selected directory |
| o | Open the selected file using the program configured by: templates.open_selected_file |
| Home / g / ^ | Select first row |
| End / G / $ | Select last row |
| z | Select middle of visible rows |
| Ctrl+f / Ctrl+d / PgDn | Scroll down one page |
| Ctrl+b / Ctrl+u / PgUp | Scroll up one page |
| Delete | Delete the selected file or directory |
| / | Filter by name |
| Ctrl+r / F5 | Refresh the current directory |
| r / F2 | Rename the selected file or directory |
| w | Open a new filectrl window in the terminal configured by: templates.open_new_window |
| t | Open the current directory in the program configured by: templates.open_current_directory |
| a, c, p | Clear alerts, clipboard content, or progress bars |
| Ctrl+c, Ctrl+x, Ctrl+v | Copy/Cut/Paste selected file or directory |
| n, m, s | Sort by name, modified date, or size |
| ? | Toggle help |
Filtering / Renaming mode
| Keys | Description |
|---|---|
| Esc | Cancel and exit filtering/renaming mode |
| Enter | Submit your input and exit filtering/renaming mode |
| ← / → | Move cursor |
| Ctrl+← / Ctrl+→ | Move cursor by word (delimited by whitespaces or punctuation) |
| Home / End | Move cursor to beginning/end of line |
| Shift+← / Shift+→ | Select text |
| Shift+Home / Shift+End | Select to beginning/end of line |
| Ctrl+Shift+← / Ctrl+Shift+→ | Select by word (delimited by whitespaces or punctuation) |
| Ctrl+a | Select all |
| Ctrl+c, Ctrl+x, Ctrl+v | Copy/Cut/Paste text |
| Backspace / Delete | Delete character before/after cursor |
The configuration is drawn from the first of the following:
- The path specified by the command line option:
--config-path - The default path, if it exists:
~/.config/filectrl/config.toml - The built-in default configuration
Run filectrl --write-config to write the default configuration to ~/.config/filectrl/config.toml.
| 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: templates.open_selected_file |
| t | Open the current directory in the program configured by: templates.open_current_directory |
| w | Open a new filectrl window in the terminal configured by: templates.open_new_window |
[templates]
# Programs to use to open files or directories:
# %s will be replaced by the path to the current working directory:
open_current_directory = "alacritty --working-directory %s"
open_new_window = "alacritty --command filectrl %s"
# %s will be replaced by the path to the selected file or directory:
open_selected_file = "pcmanfm %s"All colors can be changed by editing the configuration file:
filectrl --write-config
vim ~/.config/filectrl/config.tomlYou can see all of the available theme variables in the default configuration.
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/- andornaut@github /til/rust
- See Cargo.toml for dependencies.
- Download files and folders of various types to test colors
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>errChanging cargo-husky configuration:
- Edit the
[dev-dependencies.cargo-husky]section of Cargo.toml rm .git/hooks/pre-commit(or other hook file)cargo cleancargo test- Verify that the changes have been applied to
.git/hooks/pre-commit
