Interfaces are the means by which an installed snap gets access to system resources. Interfaces that are required for normal operation are specified at snap build-time by the developer.
Other interfaces require the user to make a manual connection, such as camera and removable-media. Once published in the Snap Store, automatic connections may be requested for these interfaces on a case-by-case basis.
For example, it may be reasonable for a photo-booth application to expect an automatic connection to the
camera interface. Those requests are submitted and processed in the open on the Snapcraft forum. For more details on this process, see Permission requests .
Plugs and slots
Interfaces are implemented as
slots. A plug in one snap may connect to a slot in another and this provides access to the resources required. For example the
ohmygiraffe snap specifies the
opengl plug which connects to the
opengl slot provided elsewhere - in this case by the
Users may view the interfaces used as a list of
slots via the
snap connections command:
$ snap connections ohmygiraffe Interface Plug Slot Notes network ohmygiraffe:network :network - network-bind ohmygiraffe:network-bind :network-bind - opengl ohmygiraffe:opengl :opengl - pulseaudio ohmygiraffe:pulseaudio :pulseaudio - x11 ohmygiraffe:x11 :x11 -
Developers specify a list of
plugs for each application inside a snap being exposed to the host OS. Each application may have a different set of
plugs specified. Developers should endeavour to list only the
plugs required for normal operation of the application.
In a simplified example, a snap which contains both a server, which connects to a webcam to stream online, and a graphical application, to view the camera, may have interfaces listed as follows:
apps: streamer: command: bin/streamer-cli plugs: - network-bind - camera frontend: command: bin/frontend-gui plugs: - network - camera - x11
See Supported interfaces for the full list of interfaces available for snaps to use.