• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

scripts/H03-May-2022-9454

user_scripts/H25-May-2020-4128

.gitignoreH A D25-May-20207 21

LICENSEH A D25-May-20201 KiB2217

MakefileH A D25-May-20201.1 KiB4836

README.mdH A D25-May-20205.5 KiB131101

cf.cH A D03-May-202275 KiB2,9752,238

cfiles.1H A D25-May-20201.6 KiB9177

config.hH A D03-May-20222.8 KiB14344

README.md

1<h1 align="center">cfiles</h1>
2
3<p align="center">
4<a href="https://github.com/mananapr/cfiles/releases/latest"><img src="https://img.shields.io/github/release/mananapr/cfiles/all.svg" alt="Latest release" /></a>
5<a href="https://aur.archlinux.org/packages/cfiles/"><img src="https://img.shields.io/aur/version/cfiles.svg" alt="Arch Linux" /></a>
6<a href="https://github.com/mananapr/homebrew-cfiles"><img src="https://img.shields.io/badge/homebrew-v1.8-blue.svg" alt="Homebrew" /></a>
7</p>
8
9<p align="center">
10<a href="https://github.com/mananapr/cfiles/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow.svg" alt="License" /></a>
11</p>
12
13`cfiles` is a terminal file manager with vim like keybindings, written in C using the ncurses
14library. It aims to provide an interface like [ranger](https://github.com/ranger/ranger) while being lightweight, fast and
15minimal.
16
17![screenshot](cf.png)
18
19## Dependencies
20- `ncursesw`
21- `cp`and `mv` for copying and moving
22- `fzf` for searching
23- `w3mimgdisplay` or `Überzug` for image previews
24- `mediainfo` for viewing media info and file sizes
25- `atool` for archive previews
26- `poppler`(specifically `pdftoppm`) for pdf previews
27
28## Compiling and Installation
29#### Arch Linux
30Arch Linux users can use the [AUR](https://aur.archlinux.org/packages/cfiles) package.
31
32#### macOS
33macOS users can use [brew](https://github.com/mananapr/homebrew-cfiles) or [macports](https://github.com/macports/macports-ports/tree/master/sysutils/cfiles)
34
35
36#### Others
37To compile, run
38
39    make
40
41and then run,
42
43    sudo make install
44
45to install.
46
47## Keybindings
48| Key | Function |
49|:---:| --- |
50| <kbd>h j k l</kbd> | Navigation keys |
51| <kbd>G</kbd> | Go to end |
52| <kbd>g</kbd> | Go to top |
53| <kbd>H</kbd> | Go to top of current view |
54| <kbd>M</kbd> | Go to middle of current view |
55| <kbd>L</kbd> | Go to bottom of current view |
56| <kbd>pgup</kbd> | Scroll Up One Page |
57| <kbd>pgdn</kbd> | Scroll Down One Page |
58| <kbd>f</kbd> | Search using fzf |
59| <kbd>F</kbd> | Search using fzf in the present directory |
60| <kbd>S</kbd> | Open Shell in present directory |
61| <kbd>space</kbd> | Add/Remove to/from selection list |
62| <kbd>tab</kbd> | View selection list |
63| <kbd>e</kbd> | Edit selection list |
64| <kbd>u</kbd> | Empty selection list |
65| <kbd>y</kbd> | Copy files from selection list |
66| <kbd>v</kbd> | Move files from selection list |
67| <kbd>a</kbd> | Rename Files in selection list |
68| <kbd>dd</kbd> | Move files from selection list to trash |
69| <kbd>dD</kbd> | Remove selected files |
70| <kbd>i</kbd> | View mediainfo and general info |
71| <kbd>I</kbd> | View preview |
72| <kbd>.</kbd> | Toggle hidden files |
73| <kbd>b</kbd> | Toggle borders |
74| <kbd>'</kbd> | View/Goto bookmarks |
75| <kbd>m</kbd> | Add bookmark |
76| <kbd>E</kbd> | Edit bookmarks |
77| <kbd>p</kbd> | Run external script |
78| <kbd>r</kbd> | Reload |
79| <kbd>q</kbd> | Quit |
80
81## Directories Used
82`cfiles` uses `$XDG_CACHE_HOME/cfiles` directory to store the clipboard file. This is used so that the clipboard
83can be shared between multiple instances of `cfiles`. That's why I won't be adding tabs in `cfiles` because multiple
84instances can be openend and managed by any terminal multiplexer or your window manager.
85Note that this also means the selection list will persist even if all instances are closed.
86
87`cfiles` also uses `$HOME/.local/share/Trash/files` as the Trash Directory, so make sure this directory exists before you try to delete a file.
88
89For storing bookmarks, `cfiles` uses `$XDG_CACHE_HOME/cfiles/bookmarks` file. Bookmarks are stored in the form `<key>:<path>`. You can either edit this file directly
90or press `m` in `cfiles` to add new bookmarks.
91
92`cfiles` looks for external scripts in the `$XDG_CACHE_HOME/cfiles/scripts` directory. Make sure the scripts are executable before moving them to the scripts directory.
93
94If `$XDG_CACHE_HOME` is not set, then `$HOME/.cache` is used.
95
96## Opening Files
97You can set `FILE_OPENER` in `config.h` to specify your file opening program. It is set to use `xdg-open` by default but you can change it to anything like `thunar`. macOS users need to set it to `open`.
98
99## Image Previews
100You can either go with `w3mimgdisplay` or `Überzug` ([link](https://github.com/seebye/ueberzug)) for image previews.
101Each method has it's own pros and cons.
102
1031. **Überzug**
104
105To use `Überzug` for image previews, set `DISPLAYIMG` and `CLEARIMG` in `config.h` to the paths of `displayimg_uberzug` and `clearimg_uberzug` scripts respectively.
106  * Pros
107    1. Better previews when compared to `w3mimgdisplay`
108  * Cons
109    1. Can't generate previews for mp3 album arts
110    2. Non functional scrolling with arrow keys
111
112I recommend `Überzug` because the previews scale well with change in terminal size and don't disappear on changing workspaces.
113
1142. **w3mimgdisplay**
115
116To use `w3mimgdisplay` for image previews, set `DISPLAYIMG` and `CLEARIMG` in `config.h` to the paths of `displayimg` and `clearimg` scripts respectively.
117  * Pros
118    1. Faster scrolling
119    2. Can generate previews of album arts for mp3 files
120  * Cons
121    1. Previews are very inconsistent and may disappear on resizing the terminal or changing workspaces
122    2. You may have to redraw the UI while scrolling by pressing `KEY_RELOAD` (defaults to <kbd>R</kbd>)
123
124You may have to modify the scripts a little, about which you can read [here](https://wiki.vifm.info/index.php/How_to_preview_images).
125
126## Why C?
127I wanted to improve my C and learn ncurses so I decided this would be an ideal project.
128
129Apart from this, I have always wanted an alternative to ranger that is faster while still having
130a similar UI.
131