Flatpak is getting more and more popular in today’s Linux. As an universal package runs in sandbox, some of them may NOT support drag and dropping to open files due to security and/or permission issue.
It’s definitely a file permission issue. And, if you want, it’s easy to enable this function for your Flatpak applications, either via a single command or using a graphical configuration tool. And, this quick tip is going to show you how!
NOTE: Your app itself must have drag & drop support first!
Single Command to Enable Flatpak Drag’n’Drop (File Permission)
If you’re familiar with Linux commands, this can be done by running a single command in terminal window.
- Firstly, open terminal (in Ubuntu, press Ctrl+Alt+T) from app launcher.
- When terminal opens, you may first run the command below and copy the App ID for which Flatpak app you want to configure:
flatpak list --app
In my case, I want to enable the drag & drop for ‘Metadata Cleaner’, so I copied the
fr.romainvigier.MetadataCleaner
section. - Finally, run the single command to grant file permission. For example, run:
sudo flatpak override fr.romainvigier.MetadataCleaner --filesystem=$HOME/Pictures
This commands make is possible drag images from user’s “Pictures” folder (and sub-folders) and drop to ‘Metadata Cleaner’ app window to open files.
If you want to enable the feature for all files in your user folders, use:
sudo flatpak override fr.romainvigier.MetadataCleaner --filesystem=home
And, you can skip the App ID, so it applies to all installed Flatpak apps:
sudo flatpak override --filesystem=$HOME/Pictures
- (Optional) To undo the change, for example, remove the permission for user’s Pictures folder for ‘Medatada Cleaner’ app, run command:
sudo flatpak override fr.romainvigier.MetadataCleaner --nofilesystem=$HOME/Pictures
After made the changes, open or re-open the application to see the magic. For more about Flatpak file permissions, see official document.
Use graphical app Flatseal to do the trick
As you may know, there’s a graphical application called Flatseal that can mange permissions for the Flatpak apps.
Flatseal itself is available to install as a Flatpak app. Just open a terminal window and run command to install it:
flatpak install https://dl.flathub.org/repo/appstream/com.github.tchx84.Flatseal.flatpakref
Linux Mint 21 & Fedora 37 can directly search for and install it from Software Manager / Gnome Software
Then launch Flatseal and do following steps to enable the feature:
- Select all applications or a specific app from left pane.
- In right, scroll down and find out “Filesystem” section.
- Turn on “All user files” to grant permission for all user files.
- Or, click little folder icon after “Other files” and type the folder path for certain folder/folders.
Leave a Reply