-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting custom editor and file associations doesn't work with FileZilla flatpak version #40
Comments
It can never work, its sandboxed. The only thing it could do is download the file and then open it with your default editor. |
So the solution is to give the FileZilla Flatpak version certain access to a directory or app? |
You'd have to patch it to use |
Why can't it be released the same way the original app is working? |
Because |
How about handling it in a similar way as snap does? With a snap I would get a message before the editor would be executed:
|
That could be plausible and would be a discussion to have here: https://github.com/flatpak/xdg-desktop-portal/ But any solution there would require source changes to Filezilla to use said portal. It also introduces complications since what exists in the sandbox != what exists on the host. |
I'd like to precise regarding org.filezillaproject.Filezilla settings :
BACKTRACE: Thanks |
They are using the OpenURI portal https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-org.freedesktop.portal.OpenURI |
I've just upgraded my system to Ubuntu 20.04, and I've installed FileZilla as a flatpak. Unfortunately, I now have this same problem. If it's not possible to get FileZilla as a flatpak to recognise the editor, it makes the flatpak release useless to me. I'll have to revert to the PPA, which I really prefer to avoid (PPA clutter). EDIT: There's no PPA; you have to download from the website, which makes it even harder :( Given how much easier snap is to install and use than flatpak, maybe we could see FileZilla released a a snap? |
This comment was marked as off-topic.
This comment was marked as off-topic.
If it's of any help to you, I have figured out a simple workaround. (Edited 2023-08-16 and 2023-08-22 with new information.) In my case, I use the text editor My workaround is as follows. Remember that when you change the sandbox settings, you need to close FileZilla before it takes effect.
This does the job. Notes about the script:
|
I'll link to this from Flathub as well. |
unfortunately the solution above didn't work in my case. I could open local files with the editor set in filezilla-edit, but I couldn't edit the files on the server. |
I've had another look at my setup, and I notice that I had added I have edited my previous comment; see point 2. Please try again to see if it works. |
oh, wow - this fast :)))) And I forgot to mention that I had to close filezilla so the changes could take effect! Maybe you could mention this in your solution - to close or "restart" filezilla after the changes. |
Thank you @paddylandau , works for me now too :) However, I'd like to use Gnome Text Editor to edit but when I replace Would appreciate any help or advice with this. Thanks. Update: |
Edit: The instructions presented in this comment are incorrect. Check #40 (comment). Thank you @paddylandau for the tips, they directed me to a simpler solution.
/usr/bin/flatpak-spawn --host gedit %f
/usr/bin/flatpak-spawn --host gedit /run/user/1000/.flatpak/org.filezillaproject.Filezilla%f Summary:
flatpak override --user --talk-name=org.freedesktop.Flatpak org.filezillaproject.Filezilla
/usr/bin/flatpak-spawn --host gedit /run/user/1000/.flatpak/org.filezillaproject.Filezilla%f |
Thank you, @Matige . Unfortunately, this doesn't work for me! I haven't used FileZilla to edit a file for a long time, so before I looked at your alternative, I tested to see if my solution still worked. It didn't! I could successfully edit a local file, but not a remote file. In other words, I was failing to access the file downloaded into Problem with my solutionI suspect that my new problem (accessing the remote file) is because when I first created the solution, I wasn't using the Flatpak version of Gedit, whereas now I am. I think that Gedit needs an extra permission to access Flatpak's pseudo Problem with your solutionNaturally, I have tested your method. Unfortunately, it's even worse: With your method, I can access neither the local nor the remote file. The problem with the local file is because you have specified the full path starting with Note: My I'll post back here if I manage to work out how to use the Flatpak version of Gedit with FileZilla. |
@paddylandau, I fully agree with you. My solution isn't working properly. I have explored the issue too little. For systems other than Windows and Mac, FileZilla sets the location of temporary files as follows: #else
if (!ret.SetPath(GetEnv("TMPDIR"))) {
if (!ret.SetPath(GetEnv("TMP"))) {
if (!ret.SetPath(GetEnv("TEMP"))) {
ret.SetPath(L"/tmp");
}
}
}
#endif The Flatpak has introduced support for shared temporary directory as of version 1.11.1 (flatpak/flatpak@b65b3f6). It maps the directory It would seem that the solution is to set the So I reached out to the Flatpak documentation (I should start there).
[...]
In that case, the solution is to set the TEMPDIR environment variable for FileZilla: flatpak override --user --env TMPDIR="${XDG_RUNTIME_DIR}/app/org.filezillaproject.Filezilla" org.filezillaproject.Filezilla Now the edited files are downloaded to Final summary
flatpak override --user --talk-name=org.freedesktop.Flatpak org.filezillaproject.Filezilla
flatpak override --user --env TMPDIR="${XDG_RUNTIME_DIR}/app/org.filezillaproject.Filezilla" org.filezillaproject.Filezilla
/usr/bin/flatpak-spawn --host gedit %f Reflections One might ask why not simply grant FileZilla access to the There is still the issue of accessing the temporary directory from another Flatpak application (such as gedit installed as flatpak). The flatpak application only has access to its own directory, so gedit can access
flatpak --user override --filesystem="${XDG_RUNTIME_DIR}/app/org.filezillaproject.Filezilla" org.gnome.gedit
|
@Matige — Thank you so much! Thanks to your investigation, I have managed to make it work. Here are the steps:
|
Hi, any chance to have this feature working out of the box of the flatpak version ? |
No, the entire feature is incompatible with running in a sandbox. |
Thanks for the answer. However I thought that a portal could be used as shown in #40 (comment) ? |
If the feature is redesigned upstream, sure some things can work. But that isn't how it currently works and would have less flexibility than how it currently works. |
Thanks |
I am using FileZilla flatpak version
3.45.1
and getting the following error when trying to open a file or changing the custom editor:The file 'index.html' cannot be opened: The associated program (/usr/bin/code) could not be found. Please check your filetype associations.
Even though I can run
/usr/bin/code
from the command line. It also worked in the old version, which was anapplication directory
and not aflatpak
.The text was updated successfully, but these errors were encountered: