akiyosi / goneovim

A GUI frontend for neovim.
MIT License
2.36k stars 59 forks source link

neovim flatpak - executable file not found #467

Closed gmankab closed 1 year ago

gmankab commented 1 year ago

i am installed neovim from flathub, and i can't make it works with goneovim

➜ ./goneovim

exec: "nvim": executable file not found in $PATH
➜ ./goneovim "nvim=flatpak run io.neovim.nvim"

exec: "nvim": executable file not found in $PATH
➜ echo "flatpak run io.neovim.nvim" | sudo tee /bin/nvim
➜ sudo chmod +x /bin/nvim
➜ ./goneovim

fork/exec /usr/bin/nvim: exec format error
akiyosi commented 1 year ago

@gmankab I am not familiar with flatpak, but is the location of the Neovim executable installed with flatpak /bin/nvim? If so, is it possible to run it with the following command?

/path/to/goneovim --nvim /bin/nvim
gmankab commented 1 year ago

@akiyosi, hello

the only way to run flatpak app is flatpak run io.neovim.nvim

there is no executsble in /bin/neovim

in latest example i put a script that must run noevim in /bin/neovim

shiena commented 1 year ago

I found a flatpak package for neovide, another neovim GUI. This package includes neovim and resolves path issues. I believe that packaging goneovim in a similar way would also solve path issues. https://github.com/deisi/flathub/tree/neovide

gmankab commented 1 year ago

perhaps packing goneovim in flatpak with neovim binary included will solve the problem

431

akiyosi commented 1 year ago

Ok, I understand the fact of the problem. I will try to make a flatpak package for goneovim If I make the time.

gmankab commented 1 year ago

@akiyosi, thank you

shiena commented 1 year ago

@gmankab I was able to run goneovim with the following command.

goneovim --nvim=$HOME/.local/share/flatpak/exports/bin/io.neovim.nvim
gmankab commented 1 year ago

@shiena, I didn't know it was possible

when you run a flatpak via flatpak run, it runs in isolation from the system, and it has other paths to configs

i wouldn't recommend running flatpaks without flatpak run, because then it will not be isolated, and the wrong config paths will be used

shiena commented 1 year ago

@gmankab Then you can use the wrapper script.

cat nvim-wrapper
#!/bin/sh

exec flatpak run io.neovim.nvim "$@"
chmod u+x nvim-wrapper
goneovim --nvim=./nvim-wrapper
gmankab commented 1 year ago

@shiena

image

shiena commented 1 year ago

Try changing #!/bin/sh to #!/bin/bash in nvim-wrapper.

gmankab commented 1 year ago

my problem was that i accidentally inserted an empty line at the beginning of the file

i changed


#!/bin/sh

to

#!/bin/sh

now it works, thanks @shiena

i am closing this issue, but #431 is still actual

gmankab commented 1 year ago

@akiyosi, please make goneovim automatically try to run flatpak nvim, if binary nvim is not found in the system

shiena commented 1 year ago

If you copy nvim-wrapper to a folder where the path, such as ~/.local/bin/nvim, is included, you can start goneovim without any options.

gmankab commented 1 year ago

yes, but it would be cool to free the user from having to create a wrapper script