rtfm-filemanager 1.3.9 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rtfm +42 -26
  3. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da9c8e1fd1f0c686be71e26551d824ec5a7163c63a312b52f0858947c53d9884
4
- data.tar.gz: 697e2567e81bece7afba8b466d4d6f803fb631cf410d0c2f2e44112ea88ba813
3
+ metadata.gz: 8981f5f29cc24ff888f70b1792a5abf8cfb8f50ed13af3c2f7982b72c4f9cef8
4
+ data.tar.gz: 4284525dc3e44a0e8fbb9d25f7e63089d229c33610845c9d58cc2b28f80c1cc5
5
5
  SHA512:
6
- metadata.gz: 4879b5abfa28e6f3023a48e105d20e8009f64ddbcfee3e5e6cb47a84c3fce93f645bd4cee6c6540460ef2539af9b47b21792c8cebd32a7e7dc9960b7cad497fd
7
- data.tar.gz: d52ced54337ef56d9e7e666f5139f8f8cc0a4685a2496526572aa76492e984e684d06db37e35598419e537f79d0b70ab0356bab18ef9c51cba14c9adeb473b50
6
+ metadata.gz: 4b30796732dfbfafdf7ac17900b67f98cb596f0ac9cb2724eb45fdf26a6b3040d1c05e741d3e93a2e02f756566cb197474a82d856db34e6d10f37a022a34b84b
7
+ data.tar.gz: 4d1780ff6d665a0ca585a6c248e65734fd716116f41df886b961fa01796362075a79dea786d4807fd385ea8913d081a4fafc735e2e60c6b24a7cc835aa9f8dbe
data/bin/rtfm CHANGED
@@ -46,6 +46,8 @@ JUMPING AND MARKS
46
46
  Press '-' and a letter to delete that mark
47
47
  M = Show marked items in right pane
48
48
  ' = Jump to mark (next letter is the name of the mark [a-zA-Z'])
49
+ / = Enter search string in bottom window to highlight matching items and jump to the first match
50
+ n = Jump to the next item matched by '/'
49
51
  h = Jump to Home directory
50
52
  f = Follow symlink to the directory where the target resides
51
53
  L = Start 'locate' search for files, then use '#' to jump to desired line/directory
@@ -82,7 +84,6 @@ RIGHT PANE
82
84
  - = Toggle preview in right pane (turn it off for faster traversing of directories)
83
85
 
84
86
  ADDITINAL COMMANDS
85
- / = Enter search string in bottom window to highlight matching items
86
87
  g = Run 'grep' to show files that contains the MATCH in current directory
87
88
  : = Enter "command mode" in bottom window (press ENTER to execute, press Ctrl-G to escape)
88
89
  ; = Show command history in right pane
@@ -560,28 +561,32 @@ def main_getkey # GET KEY FROM USER
560
561
  @w_r.update = true
561
562
  @w_b.update = false
562
563
  when 'S' # Show comprehensive system info
563
- @w_r.pager_cmd = ""
564
- uname = `uname -o`.chop + " "
565
- uname += `uname -r`.chop + " "
566
- uname += `uname -v`.chop + " "
567
- uname += `uname -p` + "\n"
568
- text = [[253, 1, uname]]
569
- cpu = "CPUs = " + `nproc`.chop + " "
570
- cpuinfo = `lscpu`
571
- cpu += cpuinfo[/^.*Model name:\s*(.*)/, 1] + " "
572
- cpu += "Max: " + cpuinfo[/^.*CPU max MHz:\s*(.*)/, 1][/(.*),.*/, 1] + "MHz "
573
- cpu += "Min: " + cpuinfo[/^.*CPU min MHz:\s*(.*)/, 1][/(.*),.*/, 1] + "MHz\n\n"
574
- text += [[154, 0, cpu]]
575
- mem = `free -h` + "\n"
576
- text += [[229, 0, mem]]
577
- ps = `ps -eo comm,pid,user,pcpu,pmem,stat --sort -pcpu,-pmem | head` + "\n"
578
- text += [[195, 0, ps]]
579
- disk = `df -H | head -8`
580
- text += [[172, 0, disk]]
581
- dmesg = "\nDMESG:\n"
582
- dmesg += `dmesg | tail -6`
583
- text += [[219, 0, dmesg]]
584
- w_r_info(ansifix(text))
564
+ begin
565
+ @w_r.pager_cmd = ""
566
+ uname = `uname -o`.chop + " "
567
+ uname += `uname -r`.chop + " "
568
+ uname += `uname -v`.chop + " "
569
+ uname += `uname -p` + "\n"
570
+ text = [[253, 1, uname]]
571
+ cpu = "CPUs = " + `nproc`.chop + " "
572
+ cpuinfo = `lscpu`
573
+ cpu += cpuinfo[/^.*Model name:\s*(.*)/, 1] + " "
574
+ cpu += "Max: " + cpuinfo[/^.*CPU max MHz:\s*(.*)/, 1][/(.*),.*/, 1] + "MHz "
575
+ cpu += "Min: " + cpuinfo[/^.*CPU min MHz:\s*(.*)/, 1][/(.*),.*/, 1] + "MHz\n\n"
576
+ text += [[154, 0, cpu]]
577
+ mem = `free -h` + "\n"
578
+ text += [[229, 0, mem]]
579
+ ps = `ps -eo comm,pid,user,pcpu,pmem,stat --sort -pcpu,-pmem | head` + "\n"
580
+ text += [[195, 0, ps]]
581
+ disk = `df -H | head -8`
582
+ text += [[172, 0, disk]]
583
+ dmesg = "\nDMESG:\n"
584
+ dmesg += `dmesg | tail -6`
585
+ text += [[219, 0, dmesg]]
586
+ w_r_info(ansifix(text))
587
+ rescue
588
+ w_r_info("Unable to show system info")
589
+ end
585
590
  # RIGHT PANE
586
591
  when 'ENTER' # Refresh right pane
587
592
  @w_r.clr # First clear the window, then clear any previously showing image
@@ -613,9 +618,20 @@ def main_getkey # GET KEY FROM USER
613
618
  @break = true
614
619
  @w_b.update = true
615
620
  # ADDITIONAL COMMANDS
616
- when '/' # Get search string to mark items that match #
621
+ when '/' # Get search string to mark items that match the input
617
622
  @w_b.nohistory = true
618
623
  @searched = w_b_getstr("/ ", "")
624
+ l = `ls #{@lsbase} #{@lsall} #{@lsorder} #{@lsinvert} #{@lsuser}`.split
625
+ m = l.each_index.select{|n| l[n] =~ /#{@searched}/}
626
+ i = m.find { |n| n > @index }
627
+ @index = i if i > @index unless i == nil
628
+ @index = 0 if @searched == ""
629
+ @w_r.update = true
630
+ when 'n'
631
+ l = `ls #{@lsbase} #{@lsall} #{@lsorder} #{@lsinvert} #{@lsuser}`.split
632
+ m = l.each_index.select{|n| l[n] =~ /#{@searched}/}
633
+ i = m.find { |n| n > @index }
634
+ @index = i if i > @index unless i == nil
619
635
  @w_r.update = true
620
636
  when ':' # Enter "command mode" in the bottom window - tries to execute the given command
621
637
  @w_r.nohistory = false
@@ -1049,7 +1065,6 @@ def pager_show # SHOW THE CURRENT PAGE CONTENT
1049
1065
  end_l = beg_l + @w_r.maxy - 2
1050
1066
  input = @w_r.text.lines[beg_l..end_l].join() + "\n"
1051
1067
  input.lines.count > @w_r.maxy - 2 ? @w_r.pager_more = true : @w_r.pager_more = false
1052
- #if @w_r.pager_cmd.match(/batcat/)
1053
1068
  if @w_r.text.match(/^\e\[/)
1054
1069
  syntax_highlight(input)
1055
1070
  else
@@ -1059,7 +1074,8 @@ def pager_show # SHOW THE CURRENT PAGE CONTENT
1059
1074
  else
1060
1075
  init_pair(@w_r.fg, @w_r.fg, 0)
1061
1076
  end
1062
- @w_r.attron(color_pair(@w_r.fg)) { @w_r << input }
1077
+ @w_r.attr = 0 if @w_r.attr == nil
1078
+ @w_r.attron(color_pair(@w_r.fg) | @w_r.attr) { @w_r << input }
1063
1079
  end
1064
1080
  (@w_r.maxy - @w_r.cury).times {@w_r.deleteln()} # Clear to bottom of window
1065
1081
  pager_add_markers
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.3.9
4
+ version: 1.5.0
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-10-29 00:00:00.000000000 Z
11
+ date: 2021-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -33,7 +33,8 @@ 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.3.9: Code cleanup and a minor bug fix'
36
+ other features. New in 1.5.0: Expanded ''/'' to jump to the first match and ''n''
37
+ to jump to the next matched item (''j'' and ''J'' are now gone).'
37
38
  email: g@isene.com
38
39
  executables:
39
40
  - rtfm