Skip to content

Commit

Permalink
Attempt to fix issue frankenstein91#21
Browse files Browse the repository at this point in the history
In gnome_shell role
Add tasks to find out keymap
Set keymap if var is not empty
  • Loading branch information
TimL20 committed May 28, 2021
1 parent c42f933 commit ab13d2c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion roles/gnome_shell/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,30 @@
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
when: keymap|default('', true)|length != 0
tags:
- gnome_shell
- keymap
Expand Down

0 comments on commit ab13d2c

Please sign in to comment.