rtfm-filemanager 1.8.0 → 1.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rtfm +29 -19
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b7b362688bbb8de0e062756835444e2da6e0839230eb47a285c868eef411e60
|
4
|
+
data.tar.gz: 2841157d83e87786b7add7ec78df710872a8c24f2a8b6cba207dacbd273220c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c78d672f9879fecbab67cd2360f3337d994cdbc839e1064ac186cbb1160692da914a6cafba40861ecd9dd2adde55fde18077272c2f102aa60fd94a271d47244d
|
7
|
+
data.tar.gz: cff47671b8b2072e782d98dc05a4bc0885de48223ed4debfaebf38961ef0ed4d4ffb6bae119b1af443f64cf45adf59bfcd52abc6bd14b1ec61229fab460c1ed6
|
data/bin/rtfm
CHANGED
@@ -135,6 +135,7 @@ begin # BASIC SETUP
|
|
135
135
|
def cmd?(command)
|
136
136
|
system("which #{command} > /dev/null 2>&1")
|
137
137
|
end
|
138
|
+
|
138
139
|
if cmd?('/usr/lib/w3m/w3mimgdisplay')
|
139
140
|
@w3mimgdisplay = "/usr/lib/w3m/w3mimgdisplay"
|
140
141
|
@showimage = true
|
@@ -142,6 +143,8 @@ begin # BASIC SETUP
|
|
142
143
|
@showimage = false
|
143
144
|
end
|
144
145
|
@showimage = false unless (cmd?('xwininfo') and cmd?('xdotool'))
|
146
|
+
|
147
|
+
cmd?('bat') ? @bat = "bat" : @bat = "batcat"
|
145
148
|
|
146
149
|
STDIN.set_encoding(Encoding::UTF_8) # Set encoding for STDIN
|
147
150
|
LScolors = `echo $LS_COLORS` # Import LS_COLORS
|
@@ -255,12 +258,19 @@ def getchr # PROCESS KEY PRESSES
|
|
255
258
|
when 'C' then chr = "RIGHT"
|
256
259
|
when 'D' then chr = "LEFT"
|
257
260
|
when 'Z' then chr = "S-TAB"
|
258
|
-
when '2' then chr = "INS" ; STDIN.getc
|
259
|
-
when '3' then chr = "DEL" ; STDIN.getc
|
260
|
-
when '5' then chr = "PgUP" ; STDIN.getc
|
261
|
-
when '6' then chr = "PgDOWN" ; STDIN.getc
|
262
|
-
when '7' then chr = "HOME" ; STDIN.getc
|
263
|
-
when '8' then chr = "END" ; STDIN.getc
|
261
|
+
when '2' then chr = "INS" ; chr = "C-INS" if STDIN.getc == "^"
|
262
|
+
when '3' then chr = "DEL" ; chr = "C-DEL" if STDIN.getc == "^"
|
263
|
+
when '5' then chr = "PgUP" ; chr = "C-PgUP" if STDIN.getc == "^"
|
264
|
+
when '6' then chr = "PgDOWN" ; chr = "C-PgDOWN" if STDIN.getc == "^"
|
265
|
+
when '7' then chr = "HOME" ; chr = "C-HOME" if STDIN.getc == "^"
|
266
|
+
when '8' then chr = "END" ; chr = "C-END" if STDIN.getc == "^"
|
267
|
+
end
|
268
|
+
when 'O' # Set Ctrl+ArrowKey equal to ArrowKey; May be used for other purposes in the future
|
269
|
+
case $stdin.getc
|
270
|
+
when 'a' then chr = "C-UP"
|
271
|
+
when 'b' then chr = "C-DOWN"
|
272
|
+
when 'c' then chr = "C-RIGHT"
|
273
|
+
when 'd' then chr = "C-LEFT"
|
264
274
|
end
|
265
275
|
end
|
266
276
|
when "", "" then chr = "BACK"
|
@@ -302,17 +312,17 @@ def main_getkey # GET KEY FROM USER
|
|
302
312
|
@write_conf = false
|
303
313
|
exit 0
|
304
314
|
# MOTION
|
305
|
-
when 'DOWN', 'j'
|
315
|
+
when 'DOWN', 'j', 'C-DOWN'
|
306
316
|
var_resets
|
307
317
|
@index = @index >= @max_index ? @min_index : @index + 1
|
308
318
|
@w_r.update = true
|
309
319
|
@w_b.update = true
|
310
|
-
when 'UP', 'k'
|
320
|
+
when 'UP', 'k', 'C-UP'
|
311
321
|
var_resets
|
312
322
|
@index = @index <= @min_index ? @max_index : @index - 1
|
313
323
|
@w_r.update = true
|
314
324
|
@w_b.update = true
|
315
|
-
when 'LEFT', 'h'
|
325
|
+
when 'LEFT', 'h', 'C-LEFT'
|
316
326
|
var_resets
|
317
327
|
cur_dir = Dir.pwd
|
318
328
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
@@ -321,7 +331,7 @@ def main_getkey # GET KEY FROM USER
|
|
321
331
|
@directory[Dir.pwd] = File.basename(cur_dir) unless @directory.key?(Dir.pwd)
|
322
332
|
@w_r.update = true
|
323
333
|
@w_b.update = true
|
324
|
-
when 'RIGHT', 'l'
|
334
|
+
when 'RIGHT', 'l', 'C-RIGHT'
|
325
335
|
var_resets
|
326
336
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
327
337
|
mark_latest
|
@@ -371,8 +381,6 @@ def main_getkey # GET KEY FROM USER
|
|
371
381
|
@w_r.update = false
|
372
382
|
@w_b.update = true
|
373
383
|
when 'M' # Show marks
|
374
|
-
@marks = @marks.sort.to_h
|
375
|
-
@w_r.fg = 147
|
376
384
|
marks_info
|
377
385
|
@w_r.update = false
|
378
386
|
@w_b.update = true
|
@@ -596,8 +604,8 @@ def main_getkey # GET KEY FROM USER
|
|
596
604
|
text += [[195, 0, ps]]
|
597
605
|
disk = `df -H | head -8`
|
598
606
|
text += [[172, 0, disk]]
|
599
|
-
dmesg = "\nDMESG:\n"
|
600
|
-
dmesg += `dmesg | tail -6
|
607
|
+
dmesg = "\nDMESG (latest first):\n"
|
608
|
+
dmesg += `dmesg | tail -6`.split("\n").sort.reverse.join("\n")
|
601
609
|
text += [[219, 0, dmesg]]
|
602
610
|
w_r_info(ansifix(text))
|
603
611
|
rescue
|
@@ -605,7 +613,7 @@ def main_getkey # GET KEY FROM USER
|
|
605
613
|
end
|
606
614
|
# RIGHT PANE
|
607
615
|
when 'ENTER' # Refresh right pane
|
608
|
-
@w_r.
|
616
|
+
@w_r.fill # First clear the window, then clear any previously showing image
|
609
617
|
image_show("clear") if @image; @image = false
|
610
618
|
@w_r.update = true
|
611
619
|
@w_b.update = true
|
@@ -773,7 +781,7 @@ def mark_latest
|
|
773
781
|
@marks["4"] = @marks["3"]
|
774
782
|
@marks["3"] = @marks["2"]
|
775
783
|
@marks["2"] = @marks["1"]
|
776
|
-
@marks["1"] =
|
784
|
+
@marks["1"] = @marks["'"]
|
777
785
|
@marks["'"] = Dir.pwd
|
778
786
|
end
|
779
787
|
# TOP WINDOW FUNCTIONS
|
@@ -963,8 +971,8 @@ def w_r_show # SHOW CONTENTS IN THE RIGHT WINDOW
|
|
963
971
|
# TEXT
|
964
972
|
elsif File.read(@selected).force_encoding("UTF-8").valid_encoding? and @w_r.pager == 0
|
965
973
|
begin # View the file as text if it is utf-8
|
966
|
-
@w_r.pager_cmd = "
|
967
|
-
@w_r.text =
|
974
|
+
@w_r.pager_cmd = "#{@bat} -n --color=always #{@selected_safe} 2>/dev/null"
|
975
|
+
@w_r.text = `#{@bat} -n --color=always --line-range :#{@w_r.maxy} #{@selected_safe} 2>/dev/null`
|
968
976
|
pager_start
|
969
977
|
syntax_highlight(@w_r.text)
|
970
978
|
rescue
|
@@ -1046,6 +1054,8 @@ def w_r_info(info) # SHOW INFO IN THE RIGHT WINDOW
|
|
1046
1054
|
@w_r.update = false
|
1047
1055
|
end
|
1048
1056
|
def marks_info # SHOW MARKS IN RIGHT WINDOW
|
1057
|
+
@w_r.fg = 183
|
1058
|
+
@marks = @marks.sort.to_h
|
1049
1059
|
info = "MARKS:\n"
|
1050
1060
|
unless @marks.empty?
|
1051
1061
|
@marks.each do |mark, dir|
|
@@ -1305,7 +1315,7 @@ def w_b_exec(cmd) # EXECUTE COMMAND FROM @W_B
|
|
1305
1315
|
status = Timeout::timeout(5) {
|
1306
1316
|
@w_r.clr
|
1307
1317
|
begin
|
1308
|
-
@w_r.pager_cmd = "#{cmd} |
|
1318
|
+
@w_r.pager_cmd = "#{cmd} | #{bat} -n --color=always 2>/dev/null"
|
1309
1319
|
@w_r.text = `#{@w_r.pager_cmd} 2>/dev/null`
|
1310
1320
|
rescue
|
1311
1321
|
@w_r.text = `#{cmd} 2>/dev/null`
|
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: 1.8.
|
4
|
+
version: 1.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -33,8 +33,7 @@ dependencies:
|
|
33
33
|
description: 'A full featured terminal browser with syntax highlighted files, images
|
34
34
|
shown in the terminal, videos thumbnailed, etc. You can bookmark and jump around
|
35
35
|
easily, delete, rename, copy, symlink and move files. RTFM has a a wide range of
|
36
|
-
other features. New in 1.8.
|
37
|
-
1-5 (1 being the very latest)'
|
36
|
+
other features. New in 1.8.4: Catch more Control+Key sequences'
|
38
37
|
email: g@isene.com
|
39
38
|
executables:
|
40
39
|
- rtfm
|