jarun / nnn

n³ The unorthodox terminal file manager
BSD 2-Clause "Simplified" License
18.99k stars 757 forks source link

Make an introduction video for nnn plugins #736

Closed snide closed 3 years ago

snide commented 4 years ago

@jarun I'll get one made within the next day or two. The outline will be as follows:

  1. General overview of the system, showing various plugins.
  2. How configs are handled through global env vars.
  3. How to compile nnn with icons
  4. How to make your own plugin

Yell if there is anything specific you'd like to see.

jarun commented 4 years ago

Looks good to me.

@0xACE @KlzXS @leovilok please suggest if you have anything.

jarun commented 4 years ago

Please note that it should be "introduction to nnn plugins". I feel plugins are one area users, specially newbies can make use of some good visual aid with examples.

snide commented 3 years ago

@jarun Started work on this today, but noticed compiling with master seems to bust for me. I hadn't tested your addition on my PR and admittedly I switched to a new laptop so I might be missing a core dependency. Any ideas?

image

I'll try to get this up today if I can get local compiles running.

jarun commented 3 years ago

On which OS are you? At least on Linux, BSD and Unix `getcwd(char buf, size_t size)allocates the memory ifbuf` is NULL.

snide commented 3 years ago

Arch Linux.

jarun commented 3 years ago

Please test with commit 55f2a0823a2dea256d24707fdcf44cdf7d6c5670.

0xACE commented 3 years ago

@jarun Started work on this today, but noticed compiling with master seems to bust for me. I hadn't tested your addition on my PR and admittedly I switched to a new laptop so I might be missing a core dependency. Any ideas?

image

I'll try to get this up today if I can get local compiles running.

I've been getting those warnings myself, thought it was one of my patches, but I just looked at master and they are there too. The one in your screenshot is a false positive warning and is safe to ignore. nnn should work as normal.

Though jarun's new patch removes the warning message all together.

snide commented 3 years ago

Yep. Can confirm this works. Also noticed the actual compiled nnn problem I had was not related to this but a bum UTF setting. As soon as the kids end their playdate (too much noise!) I'll get this done today. Thanks for the help folks.

snide commented 3 years ago

https://youtu.be/-knZwdd1ScU

Here you go. Tried to show off as much as a could. If this works I'll make the video more public and close out this ticket.

jarun commented 3 years ago

This is super-cool! :+1: :heart:

Please raise a PR to add this to the project README. That would be greatly helpful for new users.

jarun commented 3 years ago

An image like asciinema with a play button would be great. Also, please use a befitting caption.

0xACE commented 3 years ago

https://youtu.be/-knZwdd1ScU

Here you go. Tried to show off as much as a could. If this works I'll make the video more public and close out this ticket.

I like the video, it's is a complete walkthrough of the setup process if you ask me. Infact it was so good I followed along it to rip the NNN_FCOLOR as I cba to read the official docs :D

Regarding your ;u plugin I would recommend you change the if-block where you copy the file into:

    cp "$1" "$HOME/davecloud/in" && exit 0

In linux exit 0 commonly means "SUCCESS", anything other than exit 0 is considered some kind of error/problem indication.

and putting it as && exit 0 makes it so that if you actually get an error, the script will not exit at that point and it will bring you to read -r _. Thus prompting the user, giving you a chance to read any potential error message cp may print.

Also in bash it's important to use quotes.

Good job ! I have missed you and I look forward to seeing more content from you :) (given that you choose to continue)

snide commented 3 years ago

@jarun Can do. Do you still want the other vids up there? I don't really care, just asking so I know how to rearrange the page.

@0xACE Thanks for the tip. I only play a programmer on Github, mostly I'm a designer, so I appreciate the help. One thing I was curious about was seeing if I could get the imageview plugin for nnn to take the marks from sxiv and pipe them back to nnn as selections. It looked like sxiv could do input/output, but I wasn't sure if nnn could read it out somehow. I may see if I can figure that out next, but yeah, happy to keep contributing in the limited way I can as a designer. I need to a do a follow up on the icons PR to clean up some of the icons with weird spacing.

jarun commented 3 years ago

We will link those in a section below. This will be the new front video as it is up to date.

leovilok commented 3 years ago

@snide congrats for the video.

if I could get the imageview plugin for nnn to take the marks from sxiv and pipe them back to nnn as selections

It's possible, I tried it out a bit, you'll need this helper fonction:

tosel() {
    while read -r path ; do
        abspath "$path"
    done | tr '\n' '\0' | head -c -1 > ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection
}

and you'll need to add the -o option to sxiv invocations, and feed the output to this tosel, e.g.:

-sxiv -qt "$1" >/dev/null 2>&1 &
+sxiv -qto "$1" 2>/dev/null | tosel &

Note that:

  1. sxiv output marked files on exit, so you need to quit it to update the selection
  2. this doesn't check if the selection is empty, so this clears the selection on each imgview invocation even if no file is marked
jarun commented 3 years ago

@snide we need to move fast with the video. I think your and my timelines seldom overlap so please share a cover image for the video (something with an asciinema-like arrow on it as I requested earlier) and I will set it in the project readme for the larger audience.

snide commented 3 years ago

Frame 1 (1)

jarun commented 3 years ago

Awesome! Thank you so much!

snide commented 3 years ago

Closing the issue. I'll leave the readme to you. I made the video public on youtube, which exists at the same URL posted above.

jarun commented 3 years ago

I am setting it up right now! ;)

jarun commented 3 years ago

it's up! Check it out guys!

Do let me know if you want any adjustments.