personal-files provides access to the specified files in the user’s home. This interface gives privileged access to the user’s data.
read(plug): list of files and/or directories for read-only access (eg, ‘
read: [ $HOME/.file-read, $HOME/.dir-read ]’
write(plug): list of files and/or directories for read/write access (eg, ‘
write: [ $HOME/.file-write, $HOME/.dir-write ]’
Requires snapd version 2.37+. This interface is typically used for providing read-only access to top-level hidden data directories to snaps that are the clear owner of the directory in order to support importing from existing applications. Consumers of this interface require a snap declaration for distribution via the Snap Store.
An additional requirement for acceptance in the Global store is using a descriptive interface reference for use with
snap connections|interfaces|connect|disconnect. For example, the ‘foo’ application is packaged as a snap and the snap publisher wants to import existing configuration from
~/.config/foo into the snap. The snapcraft.yaml might be:
name: foo ... plugs: config-foo: interface: personal-files read: - $HOME/.config/foo apps: foo: plugs: - config-foo ...
With the above, a
snap connect command would look like:
snap connect foo:config-foo.