I installed the Byte (com.github.alainm23.byte) app from the flathub remote through flatpak. That is a music player app. My music library is stored in another HD than my system, which is correctly being mounted at startup at /media/myuser/D2
.
Since flatpak apps have limited access to the host environment I have to provide a filesystem permission to the app so that it can access the desired path.
According to the docs I can set that permission with the run
and override
commands.
When I launch the app from the terminal using flatpak run --filesystem=/media com.github.alainm23.byte
it works as intended and the app can access the desired path.
However when I launch the app from the system menu, the app can't access the path. I thought that by running the override command with the filesystem permission (sudo flatpak override --filesystem=/media com.github.alainm23.byte
) would solve the issue and allow the app to have access to the path even when launched from the system menu or even when running from the terminal without the permission (flatpak run com.github.alainm23.byte
), but it didn't, I even restarted my machine to test it.
When I run flatpak override --show com.github.alainm23.byte
it outputs:
[Context]
filesystems=/media;
That makes me think the permission was correctly set.
Having the override set, if I run it from the terminal without the permission (flatpak run com.github.alainm23.byte
), when trying to access the file system in the app, it outputs:
(com.github.alainm23.byte:2): Gtk-WARNING **: 11:40:55.105: Failed to measure available space: Erro ao obter informações do sistema de arquivos para /media/myuser/D2: No such file or directory
So, how can the app be launched from the system menu with permission to access /media
?
Here are some system info that might be helpful
myuser@pop-os:~$ inxi --system
System: Host: pop-os Kernel: 5.4.0-7634-generic x86_64 bits: 64 Desktop: Gnome 3.36.4
Distro: Pop!_OS 20.04 LTS
myuser@pop-os:~$ flatpak --version
Flatpak 1.6.5