0

If I create an application launcher with the following command:

mate-terminal -e /usr/local/bin/nnn 

a terminal opens and runs nnn. However, nnn doesn't have a configuration file and settings such as bookmarks are read from environment variables written in ~/.bashrc. When the above launcher command is executed, nnn is not reading its variables from .bashrc, so no bookmarks. If I open a terminal and then type 'nnn' everything runs normally.

2
  • Does it work if you source bashrc? Try mate-terminal -e ". ~/.bashrc; /usr/local/bin/nnn.
    – terdon
    Jun 13, 2020 at 16:23
  • Just tried: mate-terminal -e ". ~/bashrc; /user/local/bin/nnn" and the terminal opened and then closed.
    – w2kpro
    Jun 13, 2020 at 16:51

2 Answers 2

0

Please refer to the nnn Wiki section on Desktop integration.

To whoever deleted the earlier response: I have now linked to the project Wiki which I believe would be live as long as the project is. If the project isn't, the question becomes irrelevant.

I would like to link it instead of copying the current information here because the answer is not a one-liner and the specific project is the authentic source of the information and not stackexchange. The data can change and the commenters may not even be aware of it or remember to come back and edit their old comments.

5
  • Thanks for the info. I kept the exports in .bashrc and changed the Exec entry in ~/.local/share/application/nnn.desktop to: Exec=bash -ilc "nnn %f". Please note, it fails without the bash '-i' option. Also, I had to make a small adjustment to the icon path so that it was correctly displayed in the menu system.
    – w2kpro
    Jun 14, 2020 at 9:54
  • Also, the Application launcher now works with the following command: "mate-terminal --title='nnn file manager' --hide-menubar --profile=nnn -e 'bash -ilc /usr/local/bin/nnn'"
    – w2kpro
    Jun 14, 2020 at 10:14
  • Feel free to update the relevant program wiki (which is publicly editable) section if you have some new/interesting stuff to add. Jun 15, 2020 at 15:28
  • The link is now dead. This is why you should copy/paste the answer. May 2, 2022 at 19:38
  • No, it' not. The wiki is available. May 23, 2022 at 22:10
0

As described here, either:

  1. Clone the repository, and run make install-desktop
  2. Copy nnn.desktop to ~/.local/share/applications/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .