PeterMosmans.customize-gnome

Ansible Role: Customize GNOME

Build Status

Build Status

This role is used to personalize the GNOME desktop environment. It can install fonts and GNOME extensions, copy files like wallpapers, and change user settings. These settings can be provided in dconf or GSettings formats.

Requirements

You need the community.general collection mentioned in requirements.yml. Install it using:

ansible-galaxy install -r requirements.yml

Also, the community.general.dconf module requires the Python psutil module, which will be installed automatically.

Role Variables

All variables for this role start with gnome_. Here are the available variables:

  • gnome_user: The user whose settings you will change. For example:

    gnome_user: root
    

    If not specified, it will use the ansible_user_id (the user Ansible connects with).

  • gnome_packages: List of packages to install. For example:

    gnome_packages:
      - fonts-roboto
    
  • gnome_fonts: List of fonts to download, unzip, and install. Each item has an url, name, and list of font files. Example:

    gnome_fonts:
      - url: https://github.com/adobe-fonts/source-code-pro/archive/2.030R-ro/1.050R-it.zip
        name: SourceCodePro
        fonts: "source-code-pro-2.030R-ro-1.050R-it/OTF/*.otf"
    
  • gnome_files: List of files to copy from source to destination. Example:

    gnome_files:
      - src: gtk.css
        dest: /home/{{ gnome_user }}/.config/gtk-3.0/gtk.css
    
  • gnome_extensions: List of GNOME extensions to install. You can use id, url, and name. For example:

    gnome_extensions:
      - id: 545
    

    To enable automatically after installation:

    gnome_extensions:
      - id: 1112
        enable: yes
    
  • gnome_gsettings: List of GSettings entries to set for gnome_user. Each item has a schema, key, and value. Example:

    gnome_gsettings:
      - schema: org.gnome.desktop.interface
        key: monospace-font-name
        value: '"Source Code Pro Medium 16"'
    
  • gnome_dconf: List of dconf entries to set for gnome_user. Each item has a key and value. Example:

    gnome_dconf:
      - key: /org/gnome/desktop/background/show-desktop-icons
        value: "false"
    
  • gtk_version: Specifies the version of GTK to create a GTK configuration directory if it doesn’t already exist. Example:

    gtk_version: "gtk-3.0"
    

Dependencies

None.

Example Playbook

- hosts: all
  become: yes
  become_method: sudo
  roles:
    - role: petermosmans.customize-gnome
  vars:
    gnome_dconf:
      - key: /org/gnome/desktop/background/show-desktop-icons
        value: "false"
    gnome_extensions:
      - url: https://extensions.gnome.org/download-extension/[email protected]?version_tag=6450
        name: [email protected]
      - id: 15
      - id: 1160
        url: https://example.com/gnome-extension/1160.zip
      - id: 1236
        name: CustomNamedExtension
      - id: 1267
        name: CustomNamedExtension2
        url: https://example.com/gnome-extension/1267.zip
      - id: 1112
        enable: yes
    gnome_files:
      - src: gtk.css
        dest: "/home/{{ gnome_user }}/.config/{{ gtk_version }}/gtk.css"
    gnome_fonts:
      - url: https://github.com/adobe-fonts/source-code-pro/archive/2.030R-ro/1.050R-it.zip
        name: SourceCodePro
        fonts: "source-code-pro-2.030R-ro-1.050R-it/OTF/*.otf"
    gnome_gsettings:
      - schema: org.gnome.desktop.interface
        key: monospace-font-name
        value: '"Source Code Pro Medium 16"'
      - schema: org.gnome.shell.extensions.dash-to-panel
        schemadir: ~/.local/share/gnome-shell/extensions/[email protected]/schemas
        key: panel-position
        value: TOP
    gnome_packages:
      - fonts-roboto
    gnome_user: peter
    gtk_version: 3.0

This example installs global fonts, the Source Code Pro font, the GNOME extension "hidetopbar," and changes several settings for the user root.

License

GPLv3

Author Information

Originally created by Peter Mosmans. Contributions from many others: see contributors.

Informazioni sul progetto

Customizes settings for a GNOME desktop, including shell extensions and fonts.

Installa
ansible-galaxy install PeterMosmans.customize-gnome
Licenza
gpl-3.0
Download
5.8k
Proprietario
Lead pentester, security consultant, trainer