lfp


Logs | Files | README | README | LICENSE | GitLab


1
commit d0f2963f86a7c4e5c1c4097d928bfa4b307f45a2
2
Author: Connor Etherington <[email protected]>
3
Date:   Mon Oct 2 10:19:05 2023 +0200
4
5
    Auto-Commit Update - 20231002
6
---
7
 .gitlab/media/NodeManager.gif | Bin 0 -> 5466590 bytes
8
 .gitlab/media/OCR.gif         | Bin 0 -> 7982145 bytes
9
 .gitlab/media/PyManager.gif   | Bin 0 -> 2883584 bytes
10
 .gitlab/media/demo.gif        | Bin 37891408 -> 0 bytes
11
 .gitlab/media/fileTypes.gif   | Bin 0 -> 19035409 bytes
12
 .gitlab/media/previews.gif    | Bin 0 -> 18168515 bytes
13
 PKGBUILD                      |   2 +-
14
 README.md                     |  14 ++++-
15
 lfp.install                   |  11 +++-
16
 usr/share/doc/lfp/README.html | 139 ++++++++++++++++++++++++++++++++++++++++++
17
 usr/share/doc/lfp/README.md   |  16 ++++-
18
 usr/share/lfp/lfprc           |   4 +-
19
 12 files changed, 177 insertions(+), 9 deletions(-)
20
21
diff --git a/.gitlab/media/NodeManager.gif b/.gitlab/media/NodeManager.gif
22
new file mode 100644
23
index 0000000..3ef3378
24
Binary files /dev/null and b/.gitlab/media/NodeManager.gif differ
25
diff --git a/.gitlab/media/OCR.gif b/.gitlab/media/OCR.gif
26
new file mode 100644
27
index 0000000..bbfe9ad
28
Binary files /dev/null and b/.gitlab/media/OCR.gif differ
29
diff --git a/.gitlab/media/PyManager.gif b/.gitlab/media/PyManager.gif
30
new file mode 100644
31
index 0000000..3fa9520
32
Binary files /dev/null and b/.gitlab/media/PyManager.gif differ
33
diff --git a/.gitlab/media/demo.gif b/.gitlab/media/demo.gif
34
deleted file mode 100644
35
index 75d0f87..0000000
36
Binary files a/.gitlab/media/demo.gif and /dev/null differ
37
diff --git a/.gitlab/media/fileTypes.gif b/.gitlab/media/fileTypes.gif
38
new file mode 100644
39
index 0000000..2fdd10f
40
Binary files /dev/null and b/.gitlab/media/fileTypes.gif differ
41
diff --git a/.gitlab/media/previews.gif b/.gitlab/media/previews.gif
42
new file mode 100644
43
index 0000000..a6ec1e0
44
Binary files /dev/null and b/.gitlab/media/previews.gif differ
45
diff --git a/PKGBUILD b/PKGBUILD
46
index 3596f76..e3c27a7 100644
47
--- a/PKGBUILD
48
+++ b/PKGBUILD
49
@@ -1,7 +1,7 @@
50
 # Maintainer: Connor Etherington <[email protected]>
51
 # ---
52
 pkgname=lfp
53
-pkgver=4.1.0
54
+pkgver=4.1.1
55
 pkgrel=1
56
 pkgdesc='A wrapper for the lf file manager with in-terminal media previews, on-exit directory changing and much more'
57
 license=('MIT')
58
diff --git a/README.md b/README.md
59
index f3d345a..19fdbe8 100644
60
--- a/README.md
61
+++ b/README.md
62
@@ -4,10 +4,12 @@
63
 ### `lfp` is a simple wrapper for the `lf` file manager, with built-in file, image, and video previews, as well as on-exit directory changing.
64
 ### The program makes use of `ueberzug` to preview images, documents, and video thumbnails. Preview behavior can be altered by editing the *scope* file.
65
 
66
-**Version: 4.1.0**
67
+**Version: 4.1.1**
68
 
69
 ***
70
 
71
+![previews](./.gitlab/media/previews.gif)
72
+
73
 ## Usage:
74
 
75
 Run `lfp`. Optionally, a startup directory can be specified by a second argument. By default, `lfp` will launch in your current working directory.
76
@@ -26,6 +28,7 @@ LFP OCR is a simple OCR script that uses tesseract to extract text from images.
77
 All detected text is copied to your clipboard.
78
 
79
 
80
+![OCR](./.gitlab/media/OCR.gif)
81
 
82
 
83
 ## Installation
84
@@ -110,6 +113,8 @@ lfp is available in the AUR as `lfp` or `lfp-git`
85
 
86
 The NodeManager function provides various actions to manage a Node.js project, including:
87
 
88
+![NodeManager](./.gitlab/media/NodeManager.gif)
89
+
90
 * **↑ Arrow**: Initialize a package.json file.
91
 * **↓ Arrow**: Select a javascript file to run.
92
 * **← Arrow**: Specify package(s) to install from npm.
93
@@ -127,6 +132,8 @@ The NodeManager function provides various actions to manage a Node.js project, i
94
 
95
 The PyManager function provides various actions to manage a Python project, including:
96
 
97
+![PyManager](./.gitlab/media/PyManager.gif)
98
+
99
 * **↑ Arrow**: Create a new Conda environment at "./.🐍".
100
 * **↓ Arrow**: Select a python script to run.
101
 * **← Arrow**: Select package(s) to install from pypi.
102
@@ -155,3 +162,8 @@ The PyManager function provides various actions to manage a Python project, incl
103
 
104
 And many more.
105
 
106
+
107
+### File Type Icons:
108
+
109
+![fileTypes](./.gitlab/media/fileTypes.gif)
110
+
111
diff --git a/lfp.install b/lfp.install
112
index 6c915df..dd88f47 100644
113
--- a/lfp.install
114
+++ b/lfp.install
115
@@ -1,9 +1,14 @@
116
+install(){
117
+  which yarn >/dev/null 2>&1 && yarn install /usr/share/lfp/ocr ||
118
+    which npm >/dev/null 2>&1 && npm install /usr/share/lfp/ocr ||
119
+    true
120
+}
121
+
122
 post_install() {
123
+  install
124
   echo -e "\n \033[1;33m[+]\e[0;1;32m For on-exit directory changing, add the following line to your bash/zshrc\e[0m :\e[36m\n\n     source '/usr/share/lfp/lfpcd'\n\n\n\e[0m"
125
 }
126
 
127
 post_upgrade() {
128
-  which yarn >/dev/null 2>&1 && yarn install /usr/share/lfp/ocr ||
129
-    which npm >/dev/null 2>&1 && npm install /usr/share/lfp/ocr ||
130
-    true
131
+  install
132
 }
133
diff --git a/usr/share/doc/lfp/README.html b/usr/share/doc/lfp/README.html
134
new file mode 100644
135
index 0000000..9ac51df
136
--- /dev/null
137
+++ b/usr/share/doc/lfp/README.html
138
@@ -0,0 +1,139 @@
139
+<!DOCTYPE html>
140
+<html><head><meta charset="UTF-8" />
141
+  <meta name="viewport" content="width=device-width" initial-scale="1.0" />
142
+  <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20version%3D%221.0%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512pt%22%20height%3D%22512pt%22%20viewBox%3D%220%200%20512%20512%22%20preserveAspectRatio%3D%22xMidYMid%20meet%22%3E%3Cg%20transform%3D%22translate(0.000000%2C512.000000)%20scale(0.100000%2C-0.100000)%22%20fill%3D%22%230e0%22%20stroke%3D%22none%22%3E%3Cpath%20d%3D%22M2405%205099%20c-94%20-14%20-233%20-57%20-315%20-98%20-90%20-45%20-1366%20-781%20-1429%20-824%20-62%20-42%20-186%20-161%20-236%20-227%20-60%20-79%20-108%20-165%20-148%20-266%20-73%20-183%20-70%20-147%20-74%20-1064%20-5%20-880%20-2%20-953%2043%20-1107%2065%20-225%20213%20-435%20397%20-567%20103%20-73%201441%20-842%201515%20-870%20153%20-58%20215%20-69%20397%20-70%20192%20-1%20273%2014%20420%2076%2088%2038%201366%20771%201484%20852%20196%20134%20348%20346%20416%20582%2044%20150%2046%20227%2042%201104%20-4%20918%20-1%20880%20-74%201065%20-62%20156%20-140%20272%20-265%20391%20-41%2039%20-94%2084%20-119%20101%20-102%2070%20-1424%20826%20-1492%20853%20-178%2071%20-377%2096%20-562%2069z%20m287%20-440%20c29%20-6%2082%20-24%20117%20-40%2084%20-38%201363%20-776%201404%20-811%2018%20-14%2030%20-28%2027%20-30%20-20%20-17%20-1355%20-781%20-1390%20-796%20-179%20-76%20-409%20-75%20-585%203%20-56%2025%20-1353%20771%20-1373%20790%20-12%2010%20-8%2017%2020%2038%2037%2029%201285%20750%201378%20797%2033%2017%2086%2037%20118%2044%2070%2018%20213%2020%20284%205z%20m-1338%20-1662%20c362%20-209%20693%20-395%20735%20-413%2042%20-18%20115%20-43%20164%20-55%20l87%20-22%200%20-1013%200%20-1013%20-27%2010%20c-42%2014%20-143%2071%20-799%20449%20-593%20341%20-600%20346%20-684%20430%20-96%2096%20-138%20169%20-170%20297%20-19%2073%20-20%20114%20-20%20873%200%20439%203%20811%206%20828%206%2028%208%2030%2028%2020%2011%20-6%20317%20-182%20680%20-391z%20m3125%20-448%20c1%20-770%200%20-809%20-19%20-882%20-32%20-128%20-74%20-201%20-170%20-297%20-85%20-85%20-88%20-87%20-740%20-461%20-657%20-378%20-699%20-401%20-745%20-419%20l-25%20-10%200%201014%200%201013%2086%2022%20c48%2012%20119%2035%20158%2051%2040%2017%20380%20208%20757%20425%20641%20370%20684%20393%20691%20372%203%20-12%206%20-385%207%20-828z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E" />
143
+  <link rel="stylesheet" href="https://strap.concise.cc/cstrap.css" />
144
+  <title>LFP</title>
145
+  </head><body>
146
+
147
+    <h1>An lf wrapper, with built-in previews and on-exit directory changing.</h1>
148
+    <h3><code>lfp</code> is a simple wrapper for the <code>lf</code> file manager, with built-in file, image, and video previews, as well as on-exit directory changing.</h3>
149
+    <h3>The program makes use of <code>ueberzug</code> to preview images, documents, and video thumbnails. Preview behavior can be altered by editing the <em>scope</em> file.</h3>
150
+    <p><strong>Version: 4.1.1</strong></p>
151
+    <hr>
152
+    <p><img src="https://gitlab.com/a4to/lfp/-/raw/master/.gitlab/media/previews.gif" alt="previews"></p>
153
+    <h2>Usage:</h2>
154
+    <p>Run <code>lfp</code>. Optionally, a startup directory can be specified by a second argument. By default, <code>lfp</code> will launch in your current working directory.
155
+    Icons for relative file types can be changed by editing the lfp-icons file in <em>'/usr/share/lfp/lfp-icons'</em>.</p>
156
+    <p><strong>CD on exit:</strong></p>
157
+    <p>For on-exit directory changing, add the following line to your bash/zshrc:</p>
158
+    <pre><code>source '/usr/share/lfp/lfpcd'
159
+    </code></pre>
160
+    <p><strong>LFP OCR:</strong></p>
161
+    <p>LFP OCR is a simple OCR script that uses tesseract to extract text from images. It can be used as a standalone script, or as a lfp action.
162
+    All detected text is copied to your clipboard.</p>
163
+    <p><img src="https://gitlab.com/a4to/lfp/-/raw/master/.gitlab/media/OCR.gif" alt="OCR"></p>
164
+    <h2>Installation</h2>
165
+    <h3>Arch Linux</h3>
166
+    <p>lfp is available in the AUR as <code>lfp</code> or <code>lfp-git</code></p>
167
+    <h3>Manual Installation</h3>
168
+    <pre><code>tmp=$(mktemp -d);
169
+    git clone https://gitlab.com/a4to/lfp.git ${tmp} &amp;&amp;
170
+    cd ${tmp} &amp;&amp; sudo make clean install &amp;&amp; cd - &amp;&amp;
171
+    rm -rf ${tmp} &gt;/dev/null 2&gt;&amp;1 || true
172
+    </code></pre>
173
+    <p><strong>To uninstall lfp:</strong></p>
174
+    <pre><code>sudo make uninstall
175
+    </code></pre>
176
+    <h2>Prerequisites:</h2>
177
+    <ul>
178
+    <li><code>lf</code>: the file manager</li>
179
+    <li><code>zsh</code>: for scripting</li>
180
+    <li><code>ueberzug</code>: for image previews</li>
181
+    <li><code>ghostscript</code>: for PDF previews</li>
182
+    <li><code>graphicsmagick</code>: for SVG and GIF previews</li>
183
+    <li><code>ffmpeg</code>: for video file thumbnail previews</li>
184
+    <li><code>dialog</code>: required by many functions outside the scope of image and video previews</li>
185
+    <li><code>dunst</code>: to receive notifications upon task completion and so forth</li>
186
+    <li><code>fzf</code>: for lfp's <em>fzfp</em> (fuzzy-finding) and <em>pushto</em> (git push) capabilities</li>
187
+    <li><code>bat</code>: for text file previews</li>
188
+    <li><code>git</code>: for cloning repos from within lfp</li>
189
+    <li><code>lolcat</code>: used in lfp's <em>fzfp</em> function</li>
190
+    </ul>
191
+    <h2>Optional Dependencies:</h2>
192
+    <ul>
193
+    <li><code>nodejs</code>: to make use of lfps built in node actions manager</li>
194
+    <li><code>python3</code>: to make use of lfps built in python actions manager</li>
195
+    </ul>
196
+    <h2>Keybindings</h2>
197
+    <h3>Navigation:</h3>
198
+    <ul>
199
+    <li><strong>h</strong>: Left</li>
200
+    <li><strong>j</strong>: Down</li>
201
+    <li><strong>k</strong>: Up</li>
202
+    <li><strong>l</strong>: Right</li>
203
+    </ul>
204
+    <h3>Main Features and Functions:</h3>
205
+    <ul>
206
+    <li><strong>.</strong>: Activate NodeManager</li>
207
+    <li><strong>,</strong>: Activate PyManager</li>
208
+    <li><strong>o</strong>: Activate LFP OCR</li>
209
+    <li><strong>v</strong>: Toggle select all file(s)</li>
210
+    <li><strong>y</strong>: Copy selected file(s)</li>
211
+    <li><strong>c</strong>: Cut selected file(s)</li>
212
+    <li><strong>d</strong>: Delete selected file(s)</li>
213
+    <li><strong>p</strong>: Paste selected file(s)</li>
214
+    <li><strong>d</strong>: Delete selected file(s)</li>
215
+    <li><strong>s</strong>: Edit file you're currently hovering over</li>
216
+    <li><strong>n</strong>: Create new directory</li>
217
+    <li><strong>m</strong>: Play with mpv</li>
218
+    <li><strong>f</strong>: Activate fzfp (lfp's fuzzy-finder)</li>
219
+    <li><strong>b</strong>: Open file in default browser</li>
220
+    <li><strong>e</strong>: Prompts you for a filename to edit/create</li>
221
+    <li><strong>t</strong>: Prompts you for a filename for blank file to create</li>
222
+    <li><strong>x</strong>: Execute selected file(s)</li>
223
+    <li><strong>z</strong>: Open in <code>sxiv</code> (an image viewer)</li>
224
+    <li><strong>q</strong>: Quit lfp</li>
225
+    <li><strong>&lt;Space&gt;</strong>: Select file(s)</li>
226
+    <li><strong>&lt;Period&gt;</strong>: (.) - Activates Node Actions, various npm/yarn actions / quick command execution</li>
227
+    </ul>
228
+    <h3>NodeManager:</h3>
229
+    <p>The NodeManager function provides various actions to manage a Node.js project, including:</p>
230
+    <p><img src="https://gitlab.com/a4to/lfp/-/raw/master/.gitlab/media/NodeManager.gif" alt="NodeManager"></p>
231
+    <ul>
232
+    <li><strong>↑ Arrow</strong>: Initialize a package.json file.</li>
233
+    <li><strong>↓ Arrow</strong>: Select a javascript file to run.</li>
234
+    <li><strong>← Arrow</strong>: Specify package(s) to install from npm.</li>
235
+    <li><strong>→ Arrow</strong>: Start the server (yarn start).</li>
236
+    <li><strong>[h|d|m]</strong>:: Start the server in development mode (yarn dev).</li>
237
+    <li><strong>[b|n]</strong>: Build the project (yarn build).</li>
238
+    <li><strong>[i|I|,]</strong>: Initialize a new npm project.</li>
239
+    <li><strong>[r]</strong>: Remove specified packages.</li>
240
+    <li><strong>.</strong>: Update the server (yarn).</li>
241
+    <li><strong>/</strong>: Create a webserver on port 3000 (requires serve).</li>
242
+    <li><strong>q</strong>: Exit.</li>
243
+    </ul>
244
+    <h3>PyManager:</h3>
245
+    <p>The PyManager function provides various actions to manage a Python project, including:</p>
246
+    <p><img src="https://gitlab.com/a4to/lfp/-/raw/master/.gitlab/media/PyManager.gif" alt="PyManager"></p>
247
+    <ul>
248
+    <li><strong>↑ Arrow</strong>: Create a new Conda environment at &quot;https://gitlab.com/a4to/lfp/-/raw/master/.🐍&quot;.</li>
249
+    <li><strong>↓ Arrow</strong>: Select a python script to run.</li>
250
+    <li><strong>← Arrow</strong>: Select package(s) to install from pypi.</li>
251
+    <li><strong>→ Arrow</strong>: Run the main.py script if found.</li>
252
+    <li><strong>q</strong>: Exit.</li>
253
+    </ul>
254
+    <h3>Additional Actions and Features:</h3>
255
+    <ul>
256
+    <li><strong>B</strong>: Bulk rename</li>
257
+    <li><strong>E</strong>: Extract archive</li>
258
+    <li><strong>D</strong>: (sudo) Delete selected file(s)</li>
259
+    <li><strong>L</strong>: Symlink selected file(s) to current directory</li>
260
+    <li><strong>H</strong>: Create hardlink of selected file(s) to current directory</li>
261
+    <li><strong>R</strong>: Create relative symlink of selected file(s) to current directory</li>
262
+    <li><strong>E</strong>: Extract archive (bz2 rar gz tar tar.* tbz2 tgz zip Z 7z deb)</li>
263
+    <li><strong>C</strong>: CopyPath, this feature copies the absolute path of the file youre currently hovering over to your clipboard</li>
264
+    <li><strong>&lt;Ctrl+c&gt;</strong>: Quick clone a git repository without leaving lfp</li>
265
+    <li><strong>&lt;Ctrl+g&gt;</strong>: Activate pushto - select a branch to push to (only works inside a git repo)</li>
266
+    <li><strong>&lt;Ctrl+b&gt;</strong>: Open file in browser</li>
267
+    <li><strong>&lt;Ctrl+6&gt;</strong>: Chmod 644 selected file(s)</li>
268
+    <li><strong>&lt;Ctrl+7&gt;</strong>: Chmod 755 selected file(s)</li>
269
+    <li><strong>&lt;Ctrl+8&gt;</strong>: Chmod 700 selected file(s)</li>
270
+    <li><strong>&lt;Enter&gt;</strong>: Enter shell command</li>
271
+    </ul>
272
+    <p>And many more.</p>
273
+    <h3>File Type Icons:</h3>
274
+    <p><img src="https://gitlab.com/a4to/lfp/-/raw/master/.gitlab/media/fileTypes.gif" alt="fileTypes"></p>
275
+
276
+  </body>
277
+</html>
278
diff --git a/usr/share/doc/lfp/README.md b/usr/share/doc/lfp/README.md
279
index f3d345a..82d6fdf 100644
280
--- a/usr/share/doc/lfp/README.md
281
+++ b/usr/share/doc/lfp/README.md
282
@@ -4,10 +4,12 @@
283
 ### `lfp` is a simple wrapper for the `lf` file manager, with built-in file, image, and video previews, as well as on-exit directory changing.
284
 ### The program makes use of `ueberzug` to preview images, documents, and video thumbnails. Preview behavior can be altered by editing the *scope* file.
285
 
286
-**Version: 4.1.0**
287
+**Version: 4.1.1**
288
 
289
 ***
290
 
291
+![previews](https://gitlab.com/a4to/lfp/-/raw/master/.gitlab/media/previews.gif)
292
+
293
 ## Usage:
294
 
295
 Run `lfp`. Optionally, a startup directory can be specified by a second argument. By default, `lfp` will launch in your current working directory.
296
@@ -26,6 +28,7 @@ LFP OCR is a simple OCR script that uses tesseract to extract text from images.
297
 All detected text is copied to your clipboard.
298
 
299
 
300
+![OCR](https://gitlab.com/a4to/lfp/-/raw/master/.gitlab/media/OCR.gif)
301
 
302
 
303
 ## Installation
304
@@ -110,6 +113,8 @@ lfp is available in the AUR as `lfp` or `lfp-git`
305
 
306
 The NodeManager function provides various actions to manage a Node.js project, including:
307
 
308
+![NodeManager](https://gitlab.com/a4to/lfp/-/raw/master/.gitlab/media/NodeManager.gif)
309
+
310
 * **↑ Arrow**: Initialize a package.json file.
311
 * **↓ Arrow**: Select a javascript file to run.
312
 * **← Arrow**: Specify package(s) to install from npm.
313
@@ -127,7 +132,9 @@ The NodeManager function provides various actions to manage a Node.js project, i
314
 
315
 The PyManager function provides various actions to manage a Python project, including:
316
 
317
-* **↑ Arrow**: Create a new Conda environment at "./.🐍".
318
+![PyManager](https://gitlab.com/a4to/lfp/-/raw/master/.gitlab/media/PyManager.gif)
319
+
320
+* **↑ Arrow**: Create a new Conda environment at "https://gitlab.com/a4to/lfp/-/raw/master/.🐍".
321
 * **↓ Arrow**: Select a python script to run.
322
 * **← Arrow**: Select package(s) to install from pypi.
323
 * **→ Arrow**: Run the main.py script if found.
324
@@ -155,3 +162,8 @@ The PyManager function provides various actions to manage a Python project, incl
325
 
326
 And many more.
327
 
328
+
329
+### File Type Icons:
330
+
331
+![fileTypes](https://gitlab.com/a4to/lfp/-/raw/master/.gitlab/media/fileTypes.gif)
332
+
333
diff --git a/usr/share/lfp/lfprc b/usr/share/lfp/lfprc
334
index 436ce4a..173f80c 100644
335
--- a/usr/share/lfp/lfprc
336
+++ b/usr/share/lfp/lfprc
337
@@ -202,7 +202,7 @@ Tab   : toggle preview
338
 
339
       [ -z "$file" ] && exit 0
340
 
341
-      [ "$file" == ".." ] && srtdir=`realpath "$srtdir/.."` ||
342
+      [ "$file" == ".." ] && srtdir=`realpath "$srtdir"` ||
343
       [ -d "$srtdir/$file" ] && srtdir=`realpath "$srtdir/$file"` ||
344
       [ -f "$srtdir/$file" ] && echo "$file" | grep -qE ".(js|mjs)$" && {
345
         file=`realpath "$srtdir/$file"`
346
@@ -335,7 +335,7 @@ Tab   : toggle preview
347
 
348
       [ -z "$file" ] && exit 1
349
 
350
-      [ "$file" == ".." ] && srtdir=`realpath "$srtdir/.."` ||
351
+      [ "$file" == ".." ] && srtdir=`realpath "$srtdir"` ||
352
       [ -d "$srtdir/$file" ] && srtdir=`realpath "$srtdir/$file"` ||
353
       [ -f "$srtdir/$file" ] && echo "$file" | grep -q ".py$" && {
354
         file=`realpath "$srtdir/$file"`