• This repository has been archived on 26/Apr/2024
  • Stars
    star
    4,028
  • Rank 10,503 (Top 0.3 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 5 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ“ A simple file manager written in bash.

fff (Fucking Fast File-Manager)

img

A simple file manager written in bash.

Packaging status

  • It's Fucking Fast ๐Ÿš€
  • Minimal (only requires bash and coreutils)
  • Smooth Scrolling (using vim keybindings)
  • Works on Linux, BSD, macOS, Haiku etc.
  • Supports LS_COLORS!
  • File Operations (copy, paste, cut, ranger style bulk rename, etc) img
  • Instant as you type search
  • Tab completion for all commands!
  • Automatic CD on exit (see setup)
  • Works as a file picker in vim/neovim (link)!
  • Display images with w3m-img!
  • Supports $CDPATH.

Table of Contents

Dependencies

  • bash 3.2+
  • coreutils
    • File operations.
  • xdg-utils (optional)
    • Program handling (non-text).
    • Not needed on macos and Haiku.
    • Customizable (if not using xdg-open): $FFF_OPENER.

Dependencies for image display

  • w3m-img
  • xdotool for X.
  • fbset for the framebuffer.

Installation

Distros

  • KISS Linux (based): kiss b fff
  • FreeBSD: pkg install fff
  • Haiku: pkgman install fff
  • macOS: brew install fff
  • Nix: nix-env -iA fff
  • Void Linux: xbps-install -S fff
  • Arch Linux: pacman -S fff

Manual

  1. Download fff.
  2. Change working directory to fff.
    • cd fff
  3. Run make install inside the script directory to install the script.
    • El Capitan: make PREFIX=/usr/local install
    • Haiku: make PREFIX="$(finddir B_USER_NONPACKAGED_DIRECTORY)" MANDIR='$(PREFIX)/documentation/man' DOCDIR='$(PREFIX)/documentation/fff' install
    • OpenIndiana: gmake install
    • MinGW/MSys: make -i install
    • NOTE: You may have to run this as root.

NOTE: fff can be uninstalled easily using make uninstall. This removes all of files from your system.

CD on Exit

Bash and Zsh

# Add this to your .bashrc, .zshrc or equivalent.
# Run 'fff' with 'f' or whatever you decide to name the function.
f() {
    fff "$@"
    cd "$(cat "${XDG_CACHE_HOME:=${HOME}/.cache}/fff/.fff_d")"
}

Fish

# Add this to you config.fish or equivalent.
# Fish don't support recursive calls so use f function
function f
    fff $argv
    set -q XDG_CACHE_HOME; or set XDG_CACHE_HOME $HOME/.cache
    cd (cat $XDG_CACHE_HOME/fff/.fff_d)
end

Usage

j: scroll down
k: scroll up
h: go to parent dir
l: go to child dir

enter: go to child dir
backspace: go to parent dir

-: Go to previous dir.

g: go to top
G: go to bottom

:: go to a directory by typing.

.: toggle hidden files
/: search
t: go to trash
~: go to home
e: refresh current dir
!: open shell in current dir

x: view file/dir attributes
i: display image with w3m-img

down:  scroll down
up:    scroll up
left:  go to parent dir
right: go to child dir

f: new file
n: new dir
r: rename
X: toggle executable

y: mark copy
m: mark move
d: mark trash (~/.local/share/fff/trash/)
s: mark symbolic link
b: mark bulk rename

Y: mark all for copy
M: mark all for move
D: mark all for trash (~/.local/share/fff/trash/)
S: mark all for symbolic link
B: mark all for bulk rename

p: execute paste/move/delete/bulk_rename
c: clear file selections

[1-9]: favourites/bookmarks (see customization)

q: exit with 'cd' (if enabled).
Ctrl+C: exit without 'cd'.

Customization

# Show/Hide hidden files on open.
# (Off by default)
export FFF_HIDDEN=1

# Use LS_COLORS to color fff.
# (On by default if available)
# (Ignores FFF_COL1)
export FFF_LS_COLORS=1

# Directory color [0-9]
export FFF_COL1=2

# Status background color [0-9]
export FFF_COL2=7

# Selection color [0-9] (copied/moved files)
export FFF_COL3=6

# Cursor color [0-9]
export FFF_COL4=1

# Status foreground color [0-9]
export FFF_COL5=0

# Text Editor
export EDITOR="vim"

# File Opener
export FFF_OPENER="xdg-open"

# File Attributes Command
export FFF_STAT_CMD="stat"

# Enable or disable CD on exit.
# (On by default)
export FFF_CD_ON_EXIT=0

# CD on exit helper file
# Default: '${XDG_CACHE_HOME}/fff/fff.d'
#          If not using XDG, '${HOME}/.cache/fff/fff.d' is used.
export FFF_CD_FILE=~/.fff_d

# Trash Directory
# Default: '${XDG_DATA_HOME}/fff/trash'
#          If not using XDG, '${HOME}/.local/share/fff/trash' is used.
export FFF_TRASH=~/.local/share/fff/trash

# Trash Command
# Default: 'mv'
#          Define a custom program to use to trash files.
#          The program will be passed the list of selected files
#          and directories.
export FFF_TRASH_CMD="mv"

# Favourites (Bookmarks) (keys 1-9) (dir or file)
export FFF_FAV1=~/projects
export FFF_FAV2=~/.bashrc
export FFF_FAV3=~/Pictures/Wallpapers/
export FFF_FAV4=/usr/share
export FFF_FAV5=/
export FFF_FAV6=
export FFF_FAV7=
export FFF_FAV8=
export FFF_FAV9=

# w3m-img offsets.
export FFF_W3M_XOFFSET=0
export FFF_W3M_YOFFSET=0

# File format.
# Customize the item string.
# Format ('%f' is the current file): "str%fstr"
# Example (Add a tab before files): FFF_FILE_FORMAT="\t%f"
export FFF_FILE_FORMAT="%f"

# Mark format.
# Customize the marked item string.
# Format ('%f' is the current file): "str%fstr"
# Example (Add a ' >' before files): FFF_MARK_FORMAT="> %f"
export FFF_MARK_FORMAT=" %f*"

Customizing the keybindings.

Keybindings

This is the list of full keybindings along with their default values. You only need to modify the keybindings that you'd like to change from the default. fff will run perfectly fine without any of these defined.

### Moving around.

# Go to child directory.
export FFF_KEY_CHILD1="l"
export FFF_KEY_CHILD2=$'\e[C' # Right Arrow
export FFF_KEY_CHILD3=""      # Enter / Return

# Go to parent directory.
export FFF_KEY_PARENT1="h"
export FFF_KEY_PARENT2=$'\e[D' # Left Arrow
export FFF_KEY_PARENT3=$'\177' # Backspace
export FFF_KEY_PARENT4=$'\b'   # Backspace (Older terminals)

# Go to previous directory.
export FFF_KEY_PREVIOUS="-"

# Search.
export FFF_KEY_SEARCH="/"

# Spawn a shell.
export FFF_KEY_SHELL="!"

# Scroll down.
export FFF_KEY_SCROLL_DOWN1="j"
export FFF_KEY_SCROLL_DOWN2=$'\e[B' # Down Arrow

# Scroll up.
export FFF_KEY_SCROLL_UP1="k"
export FFF_KEY_SCROLL_UP2=$'\e[A'   # Up Arrow

# Go to top and bottom.
export FFF_KEY_TO_TOP="g"
export FFF_KEY_TO_BOTTOM="G"

# Go to dirs.
export FFF_KEY_GO_DIR=":"
export FFF_KEY_GO_HOME="~"
export FFF_KEY_GO_TRASH="t"
export FFF_KEY_REFRESH="e"

### File operations.

export FFF_KEY_YANK="y"
export FFF_KEY_MOVE="m"
export FFF_KEY_TRASH="d"
export FFF_KEY_LINK="s"
export FFF_KEY_BULK_RENAME="b"

export FFF_KEY_YANK_ALL="Y"
export FFF_KEY_MOVE_ALL="M"
export FFF_KEY_TRASH_ALL="D"
export FFF_KEY_LINK_ALL="S"
export FFF_KEY_BULK_RENAME_ALL="B"

export FFF_KEY_PASTE="p"
export FFF_KEY_CLEAR="c"

export FFF_KEY_RENAME="r"
export FFF_KEY_MKDIR="n"
export FFF_KEY_MKFILE="f"
export FFF_KEY_IMAGE="i" # display image with w3m-img

### Miscellaneous

# Show file attributes.
export FFF_KEY_ATTRIBUTES="x"

# Toggle executable flag.
export FFF_KEY_EXECUTABLE="X"

# Toggle hidden files.
export FFF_KEY_HIDDEN="."

Disabling keybindings.

You can't unset keybindings by making their value ''. What you need to do is change their value to off.

Example:

# KEY_GO_TRASH was bound to 't', now its unset.
export FFF_KEY_GO_TRASH="off"

# KEY_MKFILE is now set to 't' and its original
# keybinding is also unset 'f'.
export FFF_KEY_MKFILE="t"

Dealing with conflicting keybindings.

When rebinding a key in fff make sure you don't have two bindings with the same value. You can avoid this by setting the other conflicting key-binding to something else or by changing its value to off.

How to figure out special keys.

Below is a tiny script I've written which will tell you the exact value to use. It automates the deciphering of special key escape sequences to the exact value fff needs. Save this to a file and run it. Give it a key-press and it'll spit out the exact value needed.

#!/usr/bin/env bash
# Output the key-binding values for 'fff'.
key() {
    case "$1" in
        # Backspace.
        $'\b'|$'\177')
            printf '%s\n' "key: \$'\\b' or \$'\\177'"
        ;;

        # Escape Sequences.
        $'\e')
            read -rsn 2
            printf '%s %q\n' "key:" "${1}${REPLY}"
        ;;

        # Return / Enter.
        "")
            printf '%s\n' "key: \" \""
        ;;

        # Everything else.
        *)
            printf '%s %q\n' "key:" "$1"
        ;;
    esac
}

read -srn 1 && key "$REPLY"

Using fff in vim/neovim as a file picker

See: fff.vim

Why?

ยฏ\(ใƒ„)/ยฏ

dont touch my shrug

More Repositories

1

pure-bash-bible

๐Ÿ“– A collection of pure bash alternatives to external processes.
Shell
35,948
star
2

neofetch

๐Ÿ–ผ๏ธ A command-line system information tool written in bash 3.2+
Shell
20,984
star
3

pywal

๐ŸŽจ Generate and change color-schemes on the fly.
Python
8,114
star
4

pure-sh-bible

๐Ÿ“– A collection of pure POSIX sh alternatives to external processes.
Shell
6,293
star
5

pfetch

๐Ÿง A pretty system information tool written in POSIX sh.
Shell
2,018
star
6

sowm

An itsy bitsy floating window manager (220~ sloc!).
C
894
star
7

wal

๐ŸŽจ Generate and change colorschemes on the fly. Deprecated, use pywal instead. -->
Shell
724
star
8

pxltrm

๐Ÿ–Œ๏ธ pxltrm - [WIP] A pixel art editor inside the terminal
Shell
642
star
9

dotfiles

๐Ÿ™ dotfiles
Vim Script
541
star
10

writing-a-tui-in-bash

How to write a TUI in BASH
499
star
11

pash

๐Ÿ”’ A simple password manager using GPG written in POSIX sh.
Shell
336
star
12

birch

An IRC client written in bash
Shell
312
star
13

torque

๐Ÿš‚ A TUI client for transmission written in pure bash.
Shell
222
star
14

shfm

file manager written in posix shell
Shell
215
star
15

wal.vim

๐ŸŽจ A vim colorscheme for use with wal
Vim Script
214
star
16

promptless

๐Ÿš€ A super fast and extremely minimal shell prompt.
Shell
186
star
17

paleta

Change terminal colors on-the-fly independent of terminal emulator.
C
182
star
18

bin

๐Ÿ—‘๏ธ scripts
Shell
145
star
19

bum

๐ŸŽต Download and display album art for mpd/mopidy tracks.
Python
134
star
20

openbox-patched

PKGBUILD and patches for Openbox with Rounded Corners
111
star
21

fff.vim

A plugin for vim/neovim which allows you to use fff as a file opener.
Vim Script
103
star
22

bareutils

A coreutils written in pure bash.
Shell
88
star
23

k

kiss pkg man written in c
C
55
star
24

clutter-home

clutter your home directory!
50
star
25

eiwd

iwd without dbus
C
46
star
26

barsh

Use your terminal as a bar
Shell
38
star
27

nosj

a json parser written in pure bash
Shell
36
star
28

bush

This is an experiment to see how many standard tools and functions we can re-implement in pure bash.
Shell
33
star
29

crayon

๐ŸŽจ A dark 16 color colorscheme for Vim, Gvim, and Nvim
Vim Script
29
star
30

startpage

๐Ÿ”— Simple start page written in HTML/SCSS
CSS
29
star
31

ryuuko

๐ŸŽจ A colorscheme~
Vim Script
28
star
32

wiki

KISS Linux - Wiki (The wiki is now a part of the website)
27
star
33

hello-world.rs

๐Ÿš€Memory safe, blazing fast, configurable, minimal hello world written in rust(๐Ÿš€) under 1 line of code with few(774๐Ÿš€) dependencies๐Ÿš€
Rust
25
star
34

pow

Shell
24
star
35

root.vim

๐ŸŒด Automatically set directory to your project's root based on a known dir/file.
Vim Script
22
star
36

nfu

Neofetch Utils - A set of C programs to print system information.
C
22
star
37

wm

xcb wm
C
20
star
38

pkg

Package Manager for Kiss Linux
Shell
18
star
39

dylanaraps

17
star
40

neofetch-branding

Logos for Neofetch
15
star
41

codegolf

my bash code golfs
15
star
42

okpal

okpal - Swap on the fly between a bunch of palettes
Shell
15
star
43

eiwd_old

SEE: https://github.com/dylanaraps/eiwd
C
14
star
44

taskrunner.nvim

๐Ÿƒ Runs Gulp/Gruntfiles in terminal splits
Vim Script
14
star
45

discord-selena

Log all Discord messages for transparency
Python
12
star
46

libdbus-stub

stub libdbus to appease
C
12
star
47

str

C
11
star
48

dylan-kiss

Dylan's KISS repository
Objective-C
11
star
49

kiss-flatpak

flatpak for kiss
Shell
11
star
50

blog

Shell
10
star
51

kiss-initramfs

[WIP] initramfs tool for KISS (help wanted!)
Shell
9
star
52

sowm-patches

READ: https://github.com/dylanaraps/sowm/pull/57
8
star
53

golfetch

simple fetch script for Linux.
Shell
8
star
54

reddit-sidebar-toggle

๐Ÿ‘ฝ Toggle the sidebar on reddit.com
JavaScript
8
star
55

coal

๐Ÿš‚ A bash script that takes a list of colors and outputs them in various formats for use in other programs.
Shell
8
star
56

dylan.k1ss.org

HTML
7
star
57

wayland-experiment

Shell
6
star
58

uncompress

6
star
59

xyz-redirect

simply a cheeky way to 301 redirect https to another domain leveraging netlify to handle the SSL cert.
HTML
5
star
60

repo

๐Ÿ“ฆ Dylan's Cydia Repo
Shell
5
star
61

dlink-ssid-bypass

๐Ÿ“ก Bypass SSID validation on D-Link DSL-2750B
4
star
62

languages

Shell
4
star
63

pywal-branding

Logos for pywal
Shell
4
star
64

blag

blag
HTML
3
star
65

oldyiayias

Old website for Yiayias Greek Cafe
CSS
3
star
66

kisslinux-irc-logs

Freenode #kisslinux IRC logs (2019-2021)
3
star
67

pascal_lint.nvim

๐Ÿ† Show fpc compiler output in a neovim split.
Vim Script
3
star
68

dylanaraps.github.io-old

๐Ÿ”— My personal website.
HTML
2
star
69

2211

mnml trmnl using vte
C
2
star
70

kiss-submodule-links

Shell
2
star
71

eww-static-test

Rust
1
star
72

yiayias

Recreating Yiayia's website 6 months later
HyPhy
1
star
73

google

Remake of Google.com for an assignment
HTML
1
star