Skip to content

d/r/development: document new desktop related environment variables added in snapd 2.77#354

Merged
bboozzoo merged 4 commits into
canonical:mainfrom
bboozzoo:bboozzoo/document-new-vars
Jun 2, 2026
Merged

d/r/development: document new desktop related environment variables added in snapd 2.77#354
bboozzoo merged 4 commits into
canonical:mainfrom
bboozzoo:bboozzoo/document-new-vars

Conversation

@bboozzoo
Copy link
Copy Markdown
Contributor

Update the documentation to mention new environment variables added in snapd 2.77:

  • SNAP_APP_NAME
  • SNAP_APP_COMMON_ID
  • SNAP_APP_DESKTOP_FILE
  • SNAP_APP_BUS_NAME

See canonical/snapd#16016

…dded in snapd 2.77

Update the documentation to mention new environment variables added in
snapd 2.77:
 - SNAP_APP_NAME
 - SNAP_APP_COMMON_ID
 - SNAP_APP_DESKTOP_FILE
 - SNAP_APP_BUS_NAME

Signed-off-by: Maciek Borzecki <maciej.borzecki@canonical.com>
Copy link
Copy Markdown
Member

@olivercalder olivercalder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Some nitpicks about the examples


Only set when running an application command.

Typical value: `cmd`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something which looks more clearly like an example name?

Suggested change
Typical value: `cmd`
Typical value: `my-app-name`


Only set when running an application that has an associated desktop file on disk.

Typical value: `/var/lib/snapd/desktop/applications/org.example.Foo.desktop`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be nice to have an example for a snap without a commonID-shaped desktop file, e.g.

Suggested change
Typical value: `/var/lib/snapd/desktop/applications/org.example.Foo.desktop`
Typical value: `/var/lib/snapd/desktop/applications/org.example.Foo.desktop`
Typical value: `/var/lib/snapd/desktop/applications/my-snap-name_my-app-name.desktop`

FWIW not a single installed snap on my system has a desktop file which uses a common ID, they're all snapname_appname.desktop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, right good point


Only set when running an application that defines a `bus-name`.

Typical value: `org.example.Foo`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a typical dbus bus name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be anything IIRC, but most follow the reverse domain naming pattern:

$ busctl --user --no-pager
...
:1.92                                                                                         15954 vivaldi-bin     maciek :1.92         user@1020.service -       -
:1.93                                                                                         15954 vivaldi-bin     maciek :1.93         user@1020.service -       -
ca.desrt.dconf                                                                                13319 dconf-service   maciek :1.18         user@1020.service -       -
ca.desrt.dconf-editor                                                                             - -               -      (activatable) -                 -       -
com.belmoussaoui.Authenticator.SearchProvider                                                     - -               -      (activatable) -                 -       -
com.canonical.Unity                                                                           13219 gnome-shell     maciek :1.8          user@1020.service -       -
com.feralinteractive.GameMode                                                                     - -               -      (activatable) -                 -       -
com.github.tchx84.Flatseal                                                                        - -               -      (activatable) -                 -       -
com.mitchellh.ghostty                                                                         29839 ghostty         maciek :1.133        user@1020.service -       -
io.github.celluloid_player.Celluloid                                                              - -               -      (activatable) -                 -       -
io.snapcraft.Launcher                                                                             - -               -      (activatable) -                 -       -
io.snapcraft.SessionAgent                                                                         - -               -      (activatable) -                 -       -
io.snapcraft.Settings                                                                             - -               -      (activatable) -                 -       -
org.a11y.Bus                                                                                  13298 at-spi-bus-laun maciek :1.12         user@1020.service -       -
org.bluez.obex                                                                                17862 obexd           maciek :1.104        user@1020.service -       -
org.fedoraproject.Config.Printing                                                                 - -               -      (activatable) -                 -       -
org.ffado.Control                                                                                 - -               -      (activatable) -                 -       -
org.flatpak.Authenticator.Oci                                                                     - -               -      (activatable) -                 -       -
org.freedesktop.ColorHelper                                                                       - -               -      (activatable) -                 -       -

@bboozzoo bboozzoo requested a review from olivercalder June 1, 2026 06:39
Copy link
Copy Markdown
Member

@olivercalder olivercalder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but curious why the "Only set when ..." information about SNAP_APP_DESKTOP_FILE was removed.


The absolute path to the application's installed desktop file.

Only set when running an application that has an associated desktop file on disk. The actual value depends on whether `common-id` is defined, or whether `desktop-file-ids` attribute is added to the `desktop` interface plug, and presence of matching desktop files.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this comment? I think this is useful information, and matches the others which have "Only set when ..." comments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going a bit back and forth with the level of detail on when either of the values is set.

@bboozzoo bboozzoo merged commit 74c643d into canonical:main Jun 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants