site  contact  subhomenews

nnn file manager now in initrd

August 02, 2020 — BarryK

I posted yesterday about dropping out to the shell in the initrd, and the new 'mp' console editor:

I have been testing lots of different console file managers, and have settled on 'nnn'. It varied from too crude, non-intuitive, up to too sophisticated and too many dependencies. The initrd is a minimal Linux environment, based on 'bash' and with only statically-linked binaries. Some console file managers expect utilities to be there that aren't, and some link in libraries that bloat the binary beyond what is required.

'nnn' forked from 'noice'. The latter is simple, and would do the job, except that color-highlighting didn't work when compiled with musl, and was unable to invoke external apps such as 'mp'. Probably could have been fixed, but 'nnn' works.

Here is the 'noice' project page:

And for 'nnn':

Both projects are active, 'nnn' very much so. Photo from the 'nnn' project page:

img1 this stage, I have no idea how to use those tabs, nor how to get the dual-pane. This review shows UI snapshots that look like what I am getting:

...ah, I see, "?" brings up a list of keyboard actions. Here is a review on YouTube:

...the 'nnn' in the review has all the configure options enabled, like mouse support.  Here are other console file managers that I considered:

'nnn' is now in the initrd, in /bin. There is also /sbin/xdg-open and /etc/nnn/plugins, configured to launch 'mp' for any text file. Threw in /nnn.txt help file, as the app is keyboard-driven, without any keyboard help within the app. However, it is pretty intuitive, navigate with the arrow keys, "q" to quit, "]" for a commandline. There are reminders about those keys when dropout from the 'init' script.

The 'nnn' binary is 437KB. The only libs it linked to were libncursesw and libtinfo. There were some optional, such as libreadline, that I left out. And some other configure options I disabled, not knowing what they do. 

Here are the latest recipes for OpenEmbedded: 

Tags: easy