Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikitaivanovv/ictree
Like tree but interactive
https://github.com/nikitaivanovv/ictree
command-line command-line-interface command-line-tool interactive linux pager terminal terminal-app tree tui
Last synced: 6 days ago
JSON representation
Like tree but interactive
- Host: GitHub
- URL: https://github.com/nikitaivanovv/ictree
- Owner: NikitaIvanovV
- License: gpl-3.0
- Created: 2022-01-13T14:15:54.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-26T14:04:30.000Z (8 months ago)
- Last Synced: 2024-11-10T15:05:22.146Z (6 days ago)
- Topics: command-line, command-line-interface, command-line-tool, interactive, linux, pager, terminal, terminal-app, tree, tui
- Language: C
- Homepage: https://nikitaivanovv.github.io/ictree/
- Size: 1.11 MB
- Stars: 148
- Watchers: 9
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ictree
Sometimes I need to find some file with `locate` or `find`.
I use the command but, instead of getting several lines of output that are easy to look through, I get hundreds of them...
Then I try to pipe that mess into `tree --fromfile . | less`, hoping that it will be less of a pain to find what I'm looking for. But it's not always the case: you cannot fold directories you're not interested in within less, so you have to hold ^F...I got sick of it and made this simple program that takes a list of contents of directories and provides a terminal interface where you can fold/unfold items and jump between them quickly.
![showcase](doc/images/showcase.gif)
The program is written in C using awesome [termbox2](https://github.com/termbox/termbox2) library for rendering UI.
## Installation
### Manual
```sh
git clone --recursive https://github.com/NikitaIvanovV/ictree
cd ictree
sudo make install
```Uninstall with `sudo make uninstall`
*Warning: don't forget to add `--recursive` option to `git clone` command!
Otherwise, you will get `No such file or directory` errors while compiling.*### Alpine Linux
If you are an Alpine Linux user, you can install [`ictree`](https://pkgs.alpinelinux.org/packages?name=ictree) package (available in Alpine v3.17+ and in Edge).
```sh
apk add ictree
```### AUR
If you are an Arch Linux user, you can install [`ictree`](https://aur.archlinux.org/packages/ictree/) AUR package.
```sh
yay -S ictree
```## Usage
Basic usage:
```sh
locate something | ictree
find | ictree
```ictree can also read from a file:
```sh
ictree list.txt
```Once you invoke the command, the UI should pop up.
You can toggle folding of directories by hitting Enter.
You can move around with arrow keys but if you know the Vi commands, they are supported too!You can press y to copy a selected item into X or Wayland clipboard.
Note that you must have `xsel` or `wl-copy` installed (depending on whether you use X or Wayland) to use the command.You also can press o to write a path to standard output and exit program.
It may be useful in a system without a display server.You can define custom commands in a configuration file to open selected path in another program (e.g. an image viewer or a text editor):
```
# open file in $EDITOR
map e $EDITOR "$f"
```Please read the manual (`man ictree`) for more details on existing commands and options:
https://nikitaivanovv.github.io/ictree## License
This project is licensed under [GPLv3](https://www.gnu.org/licenses/).
Please refer to the [LICENSE](LICENSE) for more information.