Shortcuts manager

Use this job to create shortcuts in desktop and/or start menu allowing the end-user opening QGIS with a profile.


Use it

Sample job configuration in your scenario file:

- name: Create shortcuts for profiles
  uses: shortcuts-manager
  with:
    action: create_or_restore
    include:
      - profile: conf_qgis_fr
        label: "QGIS - Conf QGIS FR"
        additional_arguments: "--noversioncheck"
        desktop: false
        start_menu: true
        icon: "qgis_icon.ico"
      - profile: Oslandia
        label: "QGIS - Profil Oslandia"
        additional_arguments: "--noversioncheck"
        desktop: true
        start_menu: true
        icon: "qgis_icon_oslandia.ico"

Options

action

Tell the job what to do with shortcuts:

Possible_values:

  • create: add shortcut if not set

  • create_or_restore (default): add shortcut if not set and replace eventual existing one

  • remove: remove shortcut

include

List of shortcuts to create.
See below for the suboptions.

additional_arguments

Arguments to pass to QGIS executable.

desktop

If true, create a desktop shortcut.

icon

Filename of the icon to use for the shortcut. The path is relative to the profile folder. If not set, the defaut QGIS icon is used instead.

label

Text to display on the shortcut.

profile

Name of the profile to associate with the shortcut.

start_menu

If true, create a desktop in start menu.


How does it work

Specify the file to use in the profile.json

Add the image file to the profile folder and specify the relative filepath under the icon attribute:

{
    [...]
    "email": "qgis@oslandia.com",
    "icon": "images/qgis_icon.ico",
    [...]
}

Schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/Guts/qgis-deployment-cli/raw/main/docs/schemas/scenario/jobs/shortcuts-manager.json",
    "description": "create shortcuts in desktop and/or start menu allowing the end-user opening QGIS with a profile.",
    "title": "Shortcuts Manager.",
    "type": "object",
    "properties": {
        "action": {
            "default": "create_or_restore",
            "description": "Which action to perform with shortcuts.",
            "enum": [
                "create",
                "create_or_restore",
                "remove"
            ],
            "type": "string"
        },
        "include": {
            "description": "Name of the branch to use when working with a git repository.",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "additional_arguments": {
                        "description": "Arguments to pass to QGIS executable.",
                        "example": "--noversioncheck",
                        "type": "string"
                    },
                    "desktop": {
                        "default": false,
                        "description": "If true, create a desktop shortcut.",
                        "type": "boolean"
                    },
                    "icon": {
                        "description": "Filename of the icon to use for the shortcut.",
                        "type": "string"
                    },
                    "label": {
                        "description": "Text to display on the shortcut.",
                        "type": "string"
                    },
                    "profile": {
                        "description": "Name of the profile to associate with the shortcut.",
                        "type": "string"
                    },
                    "qgis_path": {
                        "deprecated": true,
                        "description": "Which QGIS bin/exe to use for the shortcut.",
                        "type": "string"
                    },
                    "start_menu": {
                        "default": false,
                        "description": "If true, create a shortcut in start menu.",
                        "type": "boolean"
                    }
                },
                "required": [
                    "label",
                    "profile"
                ]
            }
        }
    }
}