--- - assert: that: "'GNOME' in ansible_env.XDG_CURRENT_DESKTOP" - name: install packages become: true package: name: - gnome-tweaks - gnome-themes-extra state: latest - name: autostart ulauncher copy: dest: '{{ansible_env.HOME}}/.config/autostart/ulauncher.desktop' content: | [Desktop Entry] Name=Ulauncher Comment=Application launcher for Linux GenericName=Launcher Categories=GNOME;GTK;Utility; TryExec=/usr/bin/ulauncher Exec=env GDK_BACKEND=x11 /usr/bin/ulauncher --hide-window Icon=ulauncher Terminal=false Type=Application - name: prefer dark mode gsettings: schema: org.gnome.desktop.interface key: color-scheme value: "'prefer-dark'" - name: disable activate-window-menu keybinding gsettings: schema: org.gnome.desktop.wm.keybindings key: activate-window-menu value: '@as []' - name: disable switch-input-source keybinding gsettings: schema: org.gnome.desktop.wm.keybindings key: switch-input-source value: '@as []' - name: disable switch-input-source-backward keybinding gsettings: schema: org.gnome.desktop.wm.keybindings key: switch-input-source-backward value: '@as []' # NOTE: Use this command to see default keybindings # gsettings list-recursively | grep -i -E 'media-keys|keybindings' # NOTE: Use this command to inspect the current state of the custom keybindings # dconf dump / | sed -n '/\[org.gnome.settings-daemon.plugins.media-keys/,/^$/p' - name: 1password quick access custom keybinding dconf: state: present key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/{{item.key}}' value: '{{item.value}}' with_items: - {key: 'binding', value: "'space'"} - {key: 'command', value: "'1password --quick-access'"} - {key: 'name', value: "'1Password Quick Access'"} - name: ulauncher toggle custom keybinding dconf: state: present key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/{{item.key}}' value: '{{item.value}}' with_items: - {key: 'binding', value: "'space'"} - {key: 'command', value: "'ulauncher-toggle'"} - {key: 'name', value: "'Ulauncher Toggle'"} - name: list of entries defining custom-keybindings dconf: state: present key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings' value: "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/']" - when: ansible_distribution == 'Ubuntu' include_tasks: Ubuntu.yaml