Git Product home page Git Product logo

Comments (12)

jarun avatar jarun commented on May 14, 2024

I see now I left a MUST READ section above nlay which a user changing the file cannot overlook. One of the lines in it is:

Keep a personal backup (on GitHub Gist maybe?) of this file if you modify it. nlay is OVERWRITTEN during nnn upgrade.

The ask is very straight and blunt - if you are a power user, you handle this yourself.

There are several things to consider:

  • overwrite is obviously not desirable
  • handling checksums in GNU make is not straightforward
  • it's simpler to have a single copy but we can't merge all complex combinations
  • if we can't checksum, in every installation we are going to install the new nlay as a backup if the older nlay exists. Regular uses would never notice and miss new stuff in nlay. nnn might break when working with older nlay (hence, I gave higher priority on having stuff working for regular users, not the ones who can actually edit a shell script, however easy it is)
  • backing up the older file as a .bak doesn't make sense aesthetically either because nlay is not a config file but an executable script. However, I think this is the sanest approach.

Opinion?

from nnn.

jarun avatar jarun commented on May 14, 2024

@shaggytwodope @szlin any thoughts on this?

from nnn.

professorjamesmoriarty avatar professorjamesmoriarty commented on May 14, 2024

@jarun one method would be to "have our cake and eat it too". In the sense of providing nlay as a default. And possibly something to the effect of ~/.config/nnn/nlay_user (poor naming choice aside lol). Allowing the created file to take priority over nlay that ships by default (and maybe a fallback should an error occur in users nlay?). This would leave alot of freedom for the user. Just need to be made clear at some stage no support is offered for user edited version.

This would however need to change in how nlay is currently used. What ranger does is it copies the script scope.sh among other items from /usr/share/ranger/* to ~/.config/ranger/* when you run a --flag to begin customizing said config. While this does begin to complicate things to a degree, it's the only thing that comes to mind currently.

from nnn.

jarun avatar jarun commented on May 14, 2024

How about an option to use a custom player (nlay)? E.g.

-p /path/to/modified/nlay
?

from nnn.

professorjamesmoriarty avatar professorjamesmoriarty commented on May 14, 2024

@jarun I very much like this idea. For one it makes things far far simpler. Permits "power" users to setup things with ease avoiding any funky overwriting issues. I'd suggest making a note somewhere about being able to set a bash alias alias mynnn="nnn -p /path/mystuff/nlay".

This makes things very simple as I see it. Just need to make a few notes for users on best practices and use cases. It could be considered to create a modified nlay example and ship in /usr/share/nnn/.

from nnn.

jarun avatar jarun commented on May 14, 2024

I very much like this idea

Your comment triggered this. I'm fuzzy. In bed the last 3 days because of fever. So thanks! 👍

It could be considered to create a modified nlay example and ship in

We'll ship nlay as it is today because we need the player in vanilla state. -p would override it. ;)

from nnn.

szlin avatar szlin commented on May 14, 2024

Option solution is great; moreover, I think we can also consider to use configuration file such as /etc/nnn/nnn.conf and thus to solve this issue.

from nnn.

jarun avatar jarun commented on May 14, 2024

@szlin I would avoid reading a file from disk every time we start (as looong as possible) using options and env variables. Apart from the tiny delay ;), it also leads to the same issues for nlay upgrade we are discussing now.

from nnn.

szlin avatar szlin commented on May 14, 2024

@jarun Indeed, I/O operation always gets slow; however, the power user can set their own custom player path in nnn.conf such as nlay_path=/path/to/modified/nlay to overwrite original one.

This is what I thought and I think it can solve nplay upgrade issue - or did i misunderstand something?

Both option and conf can achieve the goal and choose one of them is enough I think :p

from nnn.

jarun avatar jarun commented on May 14, 2024

Yes, we would have that too! ;)
An alias as @shaggytwodope mentioned:

alias mynnn="nnn -p /path/mystuff/nlay"

from nnn.

szlin avatar szlin commented on May 14, 2024

Alias and conf. file are different meanings to me, maybe I am used to conf. way with Debian packaging :D

ref: https://wiki.debian.org/ConfigPackages

from nnn.

jarun avatar jarun commented on May 14, 2024

Got it now!!! I'll bank on the alias for this case though. :)

from nnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.