Command exposre

Hi there…

What determines when a command is exposed as say command vs snap-pkg-name.command?

In my yaml file I thought I exposed the command properly by using:

apps:
  budgie-welcome:
    command: usr/bin/budgie-welcome
    desktop: usr/share/applications/budgie-welcome.desktop

  budgie-themes:
    command: usr/bin/budgie-welcome --jump-to=default
    desktop: usr/share/applications/budgie-themes.desktop

  budgie-applets:
    command: usr/bin/budgie-welcome --jump-to=budgie-applets
    desktop: usr/share/applications/budgie-applets.desktop

So I expected the commands budgie-welcome, budgie-applets and budgie-themes, and not something like ubuntu-budgie-welcome.budgie-welcome.

So I obviously misunderstand something.

Thanks!

Full YAML here: https://raw.githubusercontent.com/UbuntuBudgie/budgie-welcome/master/snap/snapcraft.yaml

Normally it’s snapname.commandname, but when commandname == appname you get the top-level commandname.

Thanks for the additional info.

But wouldn’t that mean that based on my yaml:

apps:
  budgie-welcome:
    command: usr/bin/budgie-welcome

Shouldn’t the command just be budgie-welcome? And the others work with the snapName.cmdname?

No, the snap is set to be called ubuntu-budgie-welcome so the command name is not the same as the snap name (missing ubuntu-) and therefore will not be reduced from $snap.$command format.

The rule (as documented here) is:

If the app name matches the snap name, the app will be executed when the name of the snap is called. Otherwise, the executable will have the snap name and a dot prefixed to the app name.

1 Like

Ohhhhh. Ok. That makes it clear. Thank you all. I was not realizing that the snap name was tied to the command name. I thought by specifically creating the command name… Thai would over ride it.