rtfm-filemanager 3.0.3 → 3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -30
  3. data/bin/rtfm +55 -21
  4. metadata +3 -4
  5. data/.rtfm.launch +0 -28
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76bd197d0a9c8613ab381e40e427d4784ad70304c65799a2a939777be9cf6e54
4
- data.tar.gz: e386caba16205f6f9ae5694bbd6e56f58fa7c7d4947bff08380dd7ca483cfabe
3
+ metadata.gz: fe11017b37608ece785d04b740e858ee400a3518f7ec6e2e90d318c36069d431
4
+ data.tar.gz: c1f526b4b1a347c106915e6c4e03486e1adf1464c8050e153b625f1510fa6aa7
5
5
  SHA512:
6
- metadata.gz: 0ffee736412785328cdeaf2d29860d9ff0dfb948d653be36c3b82a279d579f13fcdce37c53ec4ec3dcbd67757d2e4c4397394520c73013ab67b28cf8542e38bf
7
- data.tar.gz: cf758653dbdc1894fad957729cdd25783f70545e6d26cabe48eaca62c324e7e21ac98182478094108fbee0c8a470097baf971748cfa9f2c19cbc37999b4ebd42
6
+ metadata.gz: 8cb52b1a6b0d7bd0db5f76486cde99416a1a3fcb9ceee3d1e5e0cc912c6c79c567e104982e9fa32f6a8f53a7cbbe34481f72d30980e24c9a2ffc31ac544db96e
7
+ data.tar.gz: 8376fb44256d84321f755842daa76009c5e116a86024977bd1af5bc01c24915198b51c0c082f2e609cd6181ee5dfef36484a6394a376da8f08f1816ad76c5567
data/README.md CHANGED
@@ -18,7 +18,7 @@ Note: RTFM works best with the (u)rxvt, xterm and Eterm terminal emulators.
18
18
  ## Features
19
19
 
20
20
  RTFM is one of the more feature rich terminal file managers. Some of the
21
- features:
21
+ features are:
22
22
 
23
23
  * RTFM shows images inline in the terminal (can be turned off)
24
24
  * File contents is shown with proper syntax highlighting
@@ -64,17 +64,18 @@ of the selected item (directory or file) is shown in the right pane. The right
64
64
  pane is also used to show information such as the currently tagged items, your
65
65
  (book)marks, output from commands, etc.
66
66
 
67
- You can run any command in the bottom "command line" and have the output
67
+ You can run any command in the bottom "command bar" and have the output
68
68
  presented in the right pane. Use LEFT and RIGHT keys to go back and forth on
69
69
  the command line, HOME to beginning of line, END to end of line, Backspace or
70
70
  Ctrl-h to delete previous character, Ctrl-w to delete previous word, TAB to
71
71
  complete directories and file names and ENTER to issue the command, while
72
- Ctrl-u deletes the line. Issuing ENTER on a blank line has no effect.
72
+ Ctrl-u deletes the line. Issuing ENTER on a blank line has no effect. Use
73
+ Ctrl-g to leave the command bar without executing anything.
73
74
 
74
75
  ## Installation
75
76
 
76
- You can install RTFM by simply coloning this repo and put the file `rtfm` in
77
- your "bin" directory. Or you can simply run `gem install rtfm-filemanager`.
77
+ You can install RTFM by coloning this repo and put the file `rtfm` in your
78
+ "bin" directory. Or you can simply run `gem install rtfm-filemanager`.
78
79
 
79
80
  There are two basic prerequisites needed: `x11-utils` and `xdotool`. On
80
81
  Ubuntu these would be installed via `apt install x11-utils xdotool`.
@@ -82,12 +83,12 @@ Ubuntu these would be installed via `apt install x11-utils xdotool`.
82
83
  In order to run RTFM (without generating [a bunch of
83
84
  warnings](https://github.com/isene/RTFM/issues/1)), you need to do a `gem
84
85
  install curses` (gets version 1.3.2) instead of installing via `apt install
85
- ruby-curses` (gets version 1.2.4-1build1 on Ubuntu 20.04).
86
+ ruby-curses` (gets version 1.2.4-1build1 on Ubuntu 20.04). If you install RTFM
87
+ via `gem install rtfm-filemanager`, this dependency is already taken care of.
86
88
 
87
89
  Content of text files are handled by `cat` - or by `bat` if you want beautiful
88
- highlighting. Other files are shown via external programs. It is shown if you
89
- have the program installed (Debian/Ubuntu family of Linux distros command in
90
- last column):
90
+ highlighting. Other files are shown via external programs (Debian/Ubuntu
91
+ family of Linux distros command in last column):
91
92
 
92
93
  File type | Requirements | Installation
93
94
  ----------------------------|----------------------------------|-------------------------------
@@ -109,13 +110,17 @@ sudo gem install curses
109
110
  git clone https://github.com/isene/RTFM
110
111
  cd RTFM
111
112
  sudo cp rtfm /usr/bin/
112
- cp .rtfm.launch ~/
113
- echo "source ~/.rtfm.launch" >> .zshrc # or .bashrc if you run bash as shell
113
+ ```
114
+ Or with a simpler gem install:
115
+ ```
116
+ sudo apt update
117
+ sudo apt install ruby-full git libncurses-dev x11-utils xdotool bat poppler-utils odt2txt docx2txt catdoc w3m imagemagick ffmpegthumbnailer
118
+ gem install rtfm-filemanager
114
119
  ```
115
120
 
116
121
  ## Screenshot
117
122
 
118
- ![](img/screenshot.png)
123
+ ![RTFM screenshot](img/screenshot.png)
119
124
 
120
125
  ## Image preview in the terminal
121
126
 
@@ -153,11 +158,12 @@ These are the set of keys to move around and do actions within RTFM:
153
158
  Key | Description
154
159
  -------|------------------------------------------------------------------
155
160
  ? | Show this help text
156
- r | Refresh RTFM (recreates all windows. Use on terminal resize or when there is garbage somewhere)
161
+ r | Refresh RTFM (recreates the panes. Use on terminal resize or when there is garbage somewhere)
157
162
  R | Reload configuration (~/.rtfm.conf)
158
163
  W | Write parameters to ~/.rtfm.conf (@lsall, @lslong, @lsorder, @lsinvert, @border, @width, @preview, @tagged, @marks)
159
164
  q | Quit
160
165
  Q | QUIT (without writing changes to the config file)
166
+ v | Display RTFM version in bottom command bar
161
167
 
162
168
  ### Motion
163
169
 
@@ -186,7 +192,7 @@ M | Show marked items in right pane
186
192
 
187
193
  Key | Description
188
194
  -------|------------------------------------------------------------------
189
- / | Enter search string in bottom window to highlight matching items and jump to the first match
195
+ / | Enter search string in bottom command bar to highlight matching items and jump to the first match
190
196
  \\ | Remove search pattern
191
197
  n | Jump to the next item matched by '/'
192
198
  N | Jump to the previous item matched by '/'
@@ -211,7 +217,7 @@ p | Put (copy) tagged items here
211
217
  P | PUT (move) tagged items here
212
218
  s | Create symlink to tagged items here
213
219
  d | Delete selected item and tagged items. Press 'y' to confirm
214
- c | Change/rename selected (adds command to bottom window)
220
+ c | Change/rename selected (adds the proper command to change in the command bar)
215
221
  Ctrl-o | Change ownership to user:group of selected and tagged items
216
222
  Ctrl-p | Change permissions of selected and tagged items. Format = rwxr-xr-x or 755 or rwx (applies the trio to user, group and others)
217
223
  z | Extract tagged zipped archive to current directory
@@ -225,7 +231,7 @@ a | Show all (also hidden) items
225
231
  A | Show All info per item (show item attributes)
226
232
  o | Change the order/sorting of directories (circular toggle)
227
233
  i | Invert/reverse the sorting
228
- O | Show the Ordering in the bottom window (the full ls command)
234
+ O | Show the Ordering in the bottom command bar (the full ls command)
229
235
  G | Show git status for current directory
230
236
  H | Do a cryptographic hash of the current directory with subdirs. If a previous hash was made, compare and report if there has been any change
231
237
  I | Show OpenAI's description of the selected item and its content (if available). You must have installed the ruby-openai gem and added your openai secret key in the .rtfm.conf (add `@ai = "your-secret-openai-key") for this to work. If RTFM is installed as a gem, the ruby-openai gem is included in the installation
@@ -237,7 +243,7 @@ Key | Description
237
243
  ENTER | Refresh the right pane
238
244
  TAB | Next page of the preview (if doc long and ∇ in the bottom right)
239
245
  S-TAB | Previous page (if you have moved down the document first - ∆ in the top right)
240
- w | Change the width of the left/right panes (left pane ⇒ ¼ ⅕ ⇒ ⅙ ⇒ ½ ⇒ ⅓)
246
+ w | Change the width of the left/right panes (left pane ⇒ 20%, 30%, 40%, 50%, 60%)
241
247
  \- | Toggle preview in right pane (turn it off for faster traversing of directories)
242
248
  _ | Toggle preview of images in right pane
243
249
  b | Toggle syntax highlighting (and line numbering)
@@ -247,24 +253,25 @@ b | Toggle syntax highlighting (and line numbering)
247
253
  Key | Description
248
254
  -------|------------------------------------------------------------------
249
255
  f | Show only files in the left pane matching extension(s) (e.g. "txt" or "pdf,png,jpg")
250
- F | Show only files matching a pattern (Ruby Regex) (e.g. "abc" or "ab.+12(\w3)*")
256
+ F | Show only files matching a pattern (Ruby Regex) (e.g. "abc" or "ab.+12(\w3)+")
251
257
  B | Toggle border
252
- : | Enter "command mode" in bottom window (press ENTER to execute, press Ctrl-G to escape)
258
+ : | Enter "command mode" in bottom command bar (press ENTER to execute, press Ctrl-G to escape)
253
259
  ; | Show command history in right pane
254
260
  y | Copy path of selected item to primary selection (for pasting with middle mouse button)
255
261
  Y | Copy path of selected item to clipboard
256
- C-Y | Copy content of right pane to clipboard
262
+ Ctrl-y | Copy content of right pane to clipboard
257
263
  S | Show comprehensive system info (system, CPU, filesystem, latest dmesg messages)
258
- Ctrl-n | Invoke navi (see https://github.com/denisidoro/navi) with any output in right window
259
-
260
-
261
- ## A convenient shell function
262
- Add this line to your `.bashrc` or `.zshrc` to make RTFM exit to the current
263
- directory by launching the file manager via `r` in the terminal:
264
+ Ctrl-n | Invoke navi (see https://github.com/denisidoro/navi) with any output in right pane
264
265
 
265
- `source ~/.rtfm.launch`
266
+ ## Keyboard cheat sheet
267
+ ![RTFM keyboard cheat sheet](img/rtfm-kb.png)
266
268
 
267
- ... and place the file `.rtfm.launch` in your home directory.
269
+ ## First run
270
+ The first time you run RTFM, you are greeted with a welcome message. RTFM will
271
+ then create a file (`.rtfm.launch`) in your home directory that will let you
272
+ launch RTFM via the one key command `r`. It also lets RTFM exit in the
273
+ directory you are currently in (inside of RTFM) rather than where you launched
274
+ RTFM.
268
275
 
269
276
  With this, you can jump around in your directory structure via RTFM, exit to
270
277
  the desired directory, do work in the terminal and go back into RTFM via `r`.
@@ -291,7 +298,8 @@ any files containg the word "test", you could do this:
291
298
  ```
292
299
 
293
300
  To change the default width of the left pane to something other than ⅓rd of
294
- the terminal width: `@width = 5` (would set the left pane width to ⅕th).
301
+ the terminal width: `@width = 5` (would set the left pane width to 50% of the
302
+ window size).
295
303
 
296
304
  To add borders in RTFM: `@border = true`
297
305
 
@@ -345,6 +353,6 @@ others I have found. If you come up with a feature request I feel is cool, I
345
353
  may include it. Bug reports are always welcome.
346
354
 
347
355
  A note to developers: You can hit the "@" key to enter the Ruby debug mode
348
- where anything you enter in the bottom command window will be sent to the Ruby
356
+ where anything you enter in the bottom command bar will be sent to the Ruby
349
357
  eval() function and output to the right pane. You can for instance issue
350
358
  `puts @searched` to see the currently active search pattern.
data/bin/rtfm CHANGED
@@ -14,7 +14,7 @@
14
14
  # for any damages resulting from its use. Further, I am under no
15
15
  # obligation to maintain or extend this software. It is provided
16
16
  # on an 'as is' basis without any expressed or implied warranty.
17
- @version = "3.0.3"
17
+ @version = "3.5"
18
18
 
19
19
  # PRELIMINARIES
20
20
  @help = <<HELPTEXT
@@ -104,7 +104,7 @@ RIGHT PANE
104
104
 
105
105
  ADDITIONAL COMMANDS
106
106
  f = Show only files in the left pane matching extension(s) (e.g. "txt" or "pdf,png,jpg")
107
- F = Show only files matching a pattern (Ruby Regex) (e.g. "abc" or "ab.+12(\w3)*")
107
+ F = Show only files matching a pattern (Ruby Regex) (e.g. "abc" or "ab.+12(\w3)+")
108
108
  B = Toggle border
109
109
  : = Enter "command mode" in bottom window (press ENTER to execute, press Ctrl-G to escape)
110
110
  ; = Show command history in right pane
@@ -116,30 +116,62 @@ ADDITIONAL COMMANDS
116
116
 
117
117
  COPYRIGHT: Geir Isene, 2020-3. No rights reserved. See http://isene.com for more.
118
118
  HELPTEXT
119
- @firstrun = <<FIRSTRUN
119
+ def firstrun
120
+ @firstrun = <<~FIRSTRUN
120
121
 
121
- Welcome to RTFM - the Ruby Terminal File Manager. This help text is shown on the first run.
122
- To benefit fully from all the features, you need to install some auxilliary software.
123
- On Ubuntu Linux you would use "apt install":
122
+ Welcome to RTFM - the Ruby Terminal File Manager. This help text is shown on the first run.
123
+ Next time you run RTFM, you can launch it from your terminal with a one letter command: "r"
124
+ When launched this way, RTFM will also exit in the directory you are currently in.
124
125
 
125
- Basic requirments is "x11-utils" and "xdotool": apt install x11-utils xdotool
126
- Syntax highlighting of text uses "bat": apt install bat
127
- Viewing PDFs uses "pdftotext": apt install poppler-utils
128
- Viewing LibreOffice docs uses "odt2txt": apt install odt2txt
129
- Viewing MS docx uses "docx2txt": apt install docx2txt
130
- Viewing MS pptx uses "unzip": apt install unzip
131
- Viewing MS xlsx uses "ssconvert": apt install gnumeric
132
- Viewing MS doc/xls/ppt uses "catdoc, xls2csv and catppt": apt install catdoc
133
- Viewing Images uses "w3m and ImageMagick": apt install w3m imagemagick
134
- Viewing Video thumbnails uses "ffmpegthumbnailer" apt install ffmpegthumbnailer
126
+ To benefit fully from all the features, you need to install some auxilliary software.
127
+ On Ubuntu Linux you would use "apt install":
128
+
129
+ Basic requirments is "x11-utils" and "xdotool": apt install x11-utils xdotool
130
+ Syntax highlighting of text uses "bat": apt install bat
131
+ Viewing PDFs uses "pdftotext": apt install poppler-utils
132
+ Viewing LibreOffice docs uses "odt2txt": apt install odt2txt
133
+ Viewing MS docx uses "docx2txt": apt install docx2txt
134
+ Viewing MS pptx uses "unzip": apt install unzip
135
+ Viewing MS xlsx uses "ssconvert": apt install gnumeric
136
+ Viewing MS doc/xls/ppt uses "catdoc, xls2csv and catppt": apt install catdoc
137
+ Viewing Images uses "w3m and ImageMagick": apt install w3m imagemagick
138
+ Viewing Video thumbnails uses "ffmpegthumbnailer" apt install ffmpegthumbnailer
139
+
140
+ All of the above:
141
+ apt install x11-utils xdotool bat poppler-utils odt2txt docx2txt unzip gnumeric catdoc w3m imagemagick ffmpegthumbnailer
135
142
 
136
143
  FIRSTRUN
137
- unless File.exist?(Dir.home+'/.rtfm.conf')
144
+
145
+ if not File.exist?(Dir.home+'/.rtfm.launch')
146
+ @rtfmlaunch = <<RTFMLAUNCH
147
+ # This is the RTFM launcher (https://github.com/isene/RTFM)
148
+ function r {
149
+ f=$(mktemp)
150
+ (
151
+ set +e
152
+ rtfm "$f"
153
+ code=$?
154
+ if [ "$code" != 0 ]; then
155
+ rm -f "$f"
156
+ exit "$code"
157
+ fi
158
+ )
159
+ code=$?
160
+ if [ "$code" != 0 ]; then
161
+ return "$code"
162
+ fi
163
+ d=$(<"$f")
164
+ rm -f "$f"
165
+ cd "$d"
166
+ }
167
+ RTFMLAUNCH
168
+ File.write(Dir.home+'/.rtfm.launch', @rtfmlaunch)
169
+ @shell = File.basename(`echo "$SHELL"`.chomp)
170
+ `echo "source ~/.rtfm.launch" >> .#{@shell}rc`
171
+ end
172
+
138
173
  puts @firstrun
139
- puts "... hit ENTER to show the RTFM help text."
140
- STDIN.gets
141
- puts @help
142
- puts "\n... hit ENTER to start RTFM. Enjoy :-)"
174
+ puts "\n... hit ENTER to start RTFM. Hit ? inside RTFM to show the help text. Enjoy :-)"
143
175
  STDIN.gets
144
176
  end
145
177
  begin # BASIC SETUP
@@ -150,6 +182,8 @@ begin # BASIC SETUP
150
182
  require 'curses'
151
183
  include Curses
152
184
 
185
+ firstrun unless File.exist?(Dir.home+'/.rtfm.conf')
186
+
153
187
  def cmd?(command)
154
188
  system("which #{command} > /dev/null 2>&1")
155
189
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtfm-filemanager
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: '3.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-02 00:00:00.000000000 Z
11
+ date: 2023-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -47,14 +47,13 @@ dependencies:
47
47
  description: 'A full featured terminal browser with syntax highlighted files, images
48
48
  shown in the terminal, videos thumbnailed, etc. You can bookmark and jump around
49
49
  easily, delete, rename, copy, symlink and move files. RTFM has a a wide range of
50
- other features. New in 3.0.3: Fixed OpenAI error message'
50
+ other features. New in 3.5: Simplified install :-)'
51
51
  email: g@isene.com
52
52
  executables:
53
53
  - rtfm
54
54
  extensions: []
55
55
  extra_rdoc_files: []
56
56
  files:
57
- - ".rtfm.launch"
58
57
  - README.md
59
58
  - bin/rtfm
60
59
  - rtfm-kb.png
data/.rtfm.launch DELETED
@@ -1,28 +0,0 @@
1
- # This function starts RTFM and will cd to the exit dir
2
- #
3
- # Add this line to your .bashrc or .zshrc to make RTFM exit to the
4
- # current directory by launching the file manager via r in the terminal:
5
- # source ~/.rtfm.launch
6
- # ... and place the file .rtfm.launch in your home directory.
7
- # With this, you can jump around in your directory structure via RTFM, exit to
8
- # the desired directory, do work in the terminal and go back into RTFM via r.
9
-
10
- function r {
11
- f=$(mktemp)
12
- (
13
- set +e
14
- rtfm "$f"
15
- code=$?
16
- if [ "$code" != 0 ]; then
17
- rm -f "$f"
18
- exit "$code"
19
- fi
20
- )
21
- code=$?
22
- if [ "$code" != 0 ]; then
23
- return "$code"
24
- fi
25
- d=$(<"$f")
26
- rm -f "$f"
27
- cd "$d"
28
- }