researchcloud-items

Installation scripts for SURF ResearchCloud catalog components

View the Project on GitHub UtrechtUniversity/researchcloud-items

Role desktop_file

back to index

Summary

This role can be used to easily install desktop items through the xdg-utils package. This allows for creation of Application menu items and/or autostarting applications on user login.

Requires

An environment that suports xdg-utils. Carefully read through the variables section about the requirements of files.

Description

The purpose of this role is to install a desktop file menu items through xdg-utils reusable. This role cannot be a role on itself, due to the requirement of icon files. It has to be called from inside another role (e.g. include_role) that holds the icon files in their respective files or templates folder. See below example:

# File structure example

researchcloud-items > roles
└─── application_role
│   └───files
│       │   app_name_128.png
│       │   app_name_64.png
│       templates
│       │   app_name.desktop.j2
|       tasks
│       │   main.yml
│   
└─── desktop_file
    │   ...

In the above, _128 and _64 refer to the pixel sizes (e.g. 128x128) of the icon (see desktopfile_sizes below).

The actual role can be called and passed variables as follows:

#researchcloud-items > roles > application_role > tasks > main.yml

[...]
- name: Create desktop menu items through role
  include_role:
    name: desktop_file
  vars:
    desktopfile_app_name: <app_name>
    desktopfile_sizes:
      - <size1 int>
      - <size2 int>
      ...
    modules:
      - <desktop item>
      - <desktop item>
    var1_required_for_app_name.desktop.j2: value
    var2_required_for_app_name.desktop.j2: value
    ...
[...]

Todo

Variables

Required variables

Required files

While not variables, the below files are assumed to exist in your playbook or roles /files or /templates folder. See the file structure example above.

Optional variables

See also

History

2022 Written by Sytse Groenwold

back to index