flathub / io.mpv.Mpv

https://flathub.org/apps/details/io.mpv.Mpv
9 stars 20 forks source link

Flatpak MPV override #359

Open lamyergeier opened 8 months ago

lamyergeier commented 8 months ago

On mpv Flathub it is mentioned that

Flatpak: mpv scripts needs write access. Use flatseal app to set home or host write permission

Does this mean

            FlatpakId="io.mpv.Mpv"
            flatpak override "${FlatpakId}" --filesystem=host

How to use the configuration stored at ~/.config/mpv with flatpak? What flatpak settings do I need to override?

fastrizwaan commented 8 months ago

Yes, if you need to encode video in different directories using ffmpeg flatpak run --command=ffmpeg io.mpv.Mpv then you may use flatpak override --user --filesystem=host io.mpv.Mpv

~/.config/mpv is incompatible and io.mpv.Mpv is sandboxed, it should not touch ~/.config/mpv.

lamyergeier commented 8 months ago

@fastrizwaan

Yes, if you need to encode video in different directories using ffmpeg flatpak run --command=ffmpeg io.mpv.Mpv then you may use flatpak override --user --filesystem=host io.mpv.Mpv

I want to use it because I want to use scripts ( mpv addons)

~/.config/mpv is incompatible and io.mpv.Mpv is sandboxed, it should not touch ~/.config/mpv.

Could you please elaborate what particular config settings are incompatible? Can I do the following (create symlink to ~/.config/mpv)

        cd ~/.var/app/io.mpv.Mpv/config || exit
        rm -rf mpv
        ln -s -f ~/.config/mpv .
fastrizwaan commented 8 months ago

We need to change 3 things for scripts to work with io.mpv.Mpv. 1. config file paths, 2. binary paths, 3. filesystem access.

The scripts and other conf files at ~/.config/ usually use the path "~/.config/mpv" in them. Also, they try to access ffmpeg other other tools/commands from system i.e., /usr/bin (e.g., /usr/bin/ffmpeg) so, we need to give access to system's binaries using flatpak spawn --host <system binary> inside scripts of io.mpv.Mpv you need to change the paths accordingly see https://github.com/flathub/io.mpv.Mpv/issues/345 and finally filesystem write access may be required to allow the scripts to write data on different directories (flatpak override --user --filesystem=host io.mpv.Mpv)

E.g., here's mpv-video-cutter-linux extension, which needed changes to work with io.mpv.Mpv

I'd suggest that you do not use ~/.config.mpv with flatpak mpv, because of the above 3 things.