Skip to content

Commit 5178358

Browse files
author
Derek
committed
fix(gnome): skip ui-mode when GNOME Shell not running
In headless template builds, GNOME Shell isn't running during provisioning. The ui-mode script requires a running GNOME session to enable/disable extensions. Now checks if gnome-shell is running: - If running: apply ui-mode winlike as before - If not running: save preference to ~/.config/dfe/ui-mode for application at first interactive login This allows desktop templates to build successfully while still configuring the preferred UI mode for users.
1 parent 6212619 commit 5178358

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

ansible/roles/dfe_developer/tasks/gnome_winlike.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,37 @@
1818
# APPLY WINLIKE MODE VIA UI-MODE UTILITY
1919
# ============================================================================
2020

21+
- name: Check if GNOME Shell is running
22+
ansible.builtin.shell: pgrep -x gnome-shell
23+
register: gnome_shell_running
24+
changed_when: false
25+
failed_when: false
26+
become: true
27+
become_user: "{{ dfe_actual_user }}"
28+
2129
- name: Apply Windows-like UI mode
2230
ansible.builtin.command:
2331
cmd: /usr/local/sbin/ui-mode winlike
2432
become: true
2533
become_user: "{{ dfe_actual_user }}"
2634
changed_when: true
35+
when: gnome_shell_running.rc == 0
36+
37+
- name: Save UI mode preference for first login (when GNOME not running)
38+
ansible.builtin.file:
39+
path: "{{ dfe_user_home }}/.config/dfe"
40+
state: directory
41+
owner: "{{ dfe_actual_user }}"
42+
mode: '0755'
43+
when: gnome_shell_running.rc != 0
44+
45+
- name: Write UI mode preference file for first login
46+
ansible.builtin.copy:
47+
dest: "{{ dfe_user_home }}/.config/dfe/ui-mode"
48+
content: "winlike"
49+
owner: "{{ dfe_actual_user }}"
50+
mode: '0644'
51+
when: gnome_shell_running.rc != 0
2752

2853
# ============================================================================
2954
# WALLPAPER DEPLOYMENT (system-wide, safe from apt/dnf updates)

0 commit comments

Comments
 (0)