blob: 564b963d5d752bd47db8aeffcbb03e03acd298f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# Building
To build il(hare) you must first install hare then run:
```
hare build -o il .
```
# Usage
To run il, simply pass a list of items to il's stdin:
```
ls | il
```
This will allow you to select items from the list using **j** and **k**, mark items using the spacebar and print them to stdout and exit using enter or **l**. The currently selected item is also the marked item if none have been marked with space. To quit without printing press **q**. To see other keybindings, refer to handlers.ha.
## Examples
This program can be used to allow you to choose items in order to pass them to another command.
For instance:
process killer:
```
ps aux | il | awk '{print $1}' | xargs kill
```
file chooser (this example displays information about the files using **file**), note that il supports a **-0** flag that prints NULL separated items instead of the default whitespace separated which is useful for items that contain spaces:
```
ls | il -0 | xargs -0 file
```
A launcher for a feed of urls (for instance from an rss feed reader):
feeds.txt with the following contents:
```
yt_channelname | Video Title: https://www.youtube.com/watch?v=0dKrUE_O0VE
peertube_channel | Insert title here: https://spacepub.space/w/1MnYGVguhGM7tuq2DUKtYQ
...
```
Then launch:
```
il < feeds.txt | awk '{print $NF}' | xargs mpv
```
|