forked from frankenstein91/Arch-Ansible-Install
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dconf defaults via profile and local database
Setup dconf settings using a user profile And dconf database called local This is another attempt to fix the dconf issues frankenstein91#19 frankenstein91#20 frankenstein91#21
- Loading branch information
Showing
8 changed files
with
127 additions
and
69 deletions.
There are no files selected for viewing
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
############################################################################### | ||
# Default configuration | ||
# See https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/desktop_migration_and_administration_guide/custom-default-values-system-settings | ||
# Ansible dconf module seems not to work for that... | ||
############################################################################### | ||
|
||
# General ..................................................................... | ||
|
||
- name: Create dconf profile directory | ||
file: | ||
path: /etc/dconf/profile/ | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
|
||
- name: Create user profile | ||
template: | ||
dest: /etc/dconf/profile/user | ||
src: dconf/profile/user | ||
mode: 0644 | ||
group: root | ||
owner: root | ||
|
||
- name: Create dconf DB directory | ||
file: | ||
path: /etc/dconf/db/local.d/ | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
|
||
# Background .................................................................. | ||
|
||
- name: Ensure wallpaper directory existance | ||
file: | ||
path: /usr/local/share/backgrounds/ | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
tags: | ||
- wallpaper | ||
|
||
- name: Copy wallpaper | ||
copy: | ||
src: backgrounds/wallpaper.png | ||
dest: /usr/local/share/backgrounds/wallpaper.png | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
tags: | ||
- wallpaper | ||
|
||
- name: Set default background | ||
# See https://help.gnome.org/admin/system-admin-guide/stable/desktop-background.html.en | ||
template: | ||
dest: /etc/dconf/db/local.d/01-background | ||
src: dconf/local.d/01-background | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
tags: | ||
- wallpaper | ||
|
||
# Keymap ...................................................................... | ||
|
||
- name: Try to find out host keymap | ||
command: localectl status | ||
delegate_to: localhost | ||
failed_when: false | ||
changed_when: false | ||
when: keymap|default('', true)|length == 0 | ||
register: localectl_status | ||
tags: | ||
- keymap | ||
|
||
- name: Store found host keymap | ||
set_fact: | ||
keymap: "{{ localectl_status.stdout | regex_search('Keymap:\\s*(.*)$', '\\1', multiline=True) | first }}" | ||
when: (keymap | default('', true) | length == 0) and (localectl_status.rc == 0) | ||
tags: | ||
- keymap | ||
|
||
- name: Set default keymap | ||
template: | ||
dest: /etc/dconf/db/local.d/01-input-sources | ||
src: dconf/local.d/01-input-sources | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
when: keymap|default('', true)|length != 0 | ||
tags: | ||
- keymap | ||
|
||
# Enable extensions by default | ||
|
||
- name: Set default keymap | ||
template: | ||
dest: /etc/dconf/db/local.d/10-enabled-extensions | ||
src: dconf/local.d/10-enabled-extensions | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
tags: | ||
- extensions | ||
|
||
# Update dconf database ....................................................... | ||
|
||
- name: Update dconf database | ||
command: dconf update | ||
changed_when: false # The command is idempotent... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,33 +18,13 @@ | |
tags: | ||
- gnome_shell | ||
|
||
- name: Try to find out host keymap | ||
command: localectl status | ||
delegate_to: localhost | ||
failed_when: false | ||
changed_when: false | ||
when: keymap|default('', true)|length == 0 | ||
register: localectl_status | ||
tags: | ||
- gnome_shell | ||
- keymap | ||
|
||
- name: Store found host keymap | ||
set_fact: | ||
keymap: "{{ localectl_status.stdout | regex_search('Keymap:\\s*(.*)$', '\\1', multiline=True) | first }}" | ||
when: (keymap | default('', true) | length == 0) and (localectl_status.rc == 0) | ||
tags: | ||
- gnome_shell | ||
- keymap | ||
|
||
- name: Set gnome keyboard layout | ||
dconf: | ||
key: "/org/gnome/desktop/input-sources/sources" | ||
value: "[('xkb', '{{ keymap }}')]" | ||
when: keymap|default('', true)|length != 0 | ||
tags: | ||
- gnome_shell | ||
- keymap | ||
- name: Include configuration | ||
include_tasks: | ||
file: dconf.yml | ||
apply: | ||
tags: | ||
- gnome_shell | ||
- dconf | ||
|
||
- name: Disable sleep on inactivity | ||
# Sleep on inactivity can be a problem when installation with Ansible is slow | ||
|
@@ -94,15 +74,4 @@ | |
- gnome_shell | ||
- apps | ||
|
||
- name: Enable appindicator by default | ||
# Proper name of the appindicator extension needed | ||
# Can be found in PKGBUILD of package: | ||
# [email protected] | ||
dconf: | ||
key: "/org/gnome/shell/enabled-extensions" | ||
value: "['[email protected]']" | ||
tags: | ||
- gnome_shell | ||
- apps | ||
|
||
# org.gnome.books night-mode true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[org/gnome/desktop/background] | ||
picture-uri='file:///usr/local/share/backgrounds/wallpaper.png' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[org/gnome/desktop/input-sources] | ||
sources=[('xkb', '{{ keymap }}')] |
2 changes: 2 additions & 0 deletions
2
roles/gnome_shell/templates/dconf/local.d/10-enabled-extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[org/gnome/shell] | ||
enabled-extensions=['[email protected]'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
user-db:user | ||
system-db:local |
This file was deleted.
Oops, something went wrong.