You are not logged in.
Pages: 1
When I open nnn and press on some image, it opens with feh. Problem is, I don't want it to open just feh, I want feh with my own options (like with fixed window size, and some more options). I have alias for feh, but I don't know how to make nnn use it.
Also, how to make it open .txt (and some other files which I know contains text) in new terminal window in vim (instead of opening it in browser)?
Last edited by gnome_is_ugly (2022-08-15 23:12:12)
Offline
Aliases aren't relevant. Nnn uses xdg-open (for most files) so you need to configure xdg-open to do what you want with image files. And I think xdg-open relies on desktop files - so you can make your own feh or image viewer file with whatever settings you want:
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Sorry, I don't understand.
Say, I open nnn and see somegif.gif. When I press L button (or enter), it opens this gif in feh (first frame), instead of using mpv (for example). I googled a bit and the suggestion was to do the following:
xdg-mime default mpv.desktop ~/somegif.gifThat doesn't do anything.
xdg-mime default vim.desktop ~/sometext.txtAlso doesn't change anything. nnn still opens .txt files in firefox
Also feh opens images as "default feh", not as "feh with options I set".
Offline
xdg-mime default mpv.desktop image/gif
xdg-mime default vim.desktop text/plainAs @Trilby already mentioned, if you want apps to open with custom commands by default, copy/create their '.desktop' file inside '$HOME/.local/share/applications/' and edit it accordingly.
Please be more specific about what it is that you don't understand...
Last edited by dogknowsnx (2022-08-16 22:32:26)
xdg-mime default mpv.desktop image/gif xdg-mime default vim.desktop text/plainAs @Trilby already mentioned, if you want apps to open with custom commands by default, copy/create their '.desktop' file inside '$HOME/.local/share/applications/' and edit it accordingly.
Please be more specific about what it is that you don't understand...
Thank you for reply. After reading wiki again I managed to make feh do what I want it to do (my fault). Problem is
xdg-mime query filetype ssh.txtgives
test/plainand
xdg-mime query default text/plaingives
vim.desktopBut nnn still opens firefox when I press on .txt files.
Offline
What happens when you run `xdg-open ssh.txt` (in the same directory as that file)?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
What happens when you run `xdg-open ssh.txt` (in the same directory as that file)?
it opens vim (as if "vim ssh.txt"). But typing "nnn" in this directory and pressing enter (or L) on any txt file opens it in firefox.
Offline
That confirms it's an issue internal to nnn then. I tried to review the code, but there are functions over 1000 lines long and I was getting a bit lost. It *looks* like it's supposed to rely on xdg-open for such things but apparently there are exceptions. You could direct your question upstream (the issue tracker on their github looks like the right place).
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Are you using the 'nuke' plugin, by any chance?
printenv | grep nnnAre you using the 'nuke' plugin, by any chance?
printenv | grep nnn
No idea what 'nuke' plugin is.
printenv | grep nnngives nothing.
Offline
Wouldn't that need to be "grep -i nnn" or "grep NNN" in order to be informative?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Wouldn't that need to be "grep -i nnn" or "grep NNN" in order to be informative?
printenv | grep nuke ![]()
printenv | grep nuke
printenv | grep NNN
printenv | grep -i nnnnone of those gives output.
Offline
Pages: 1