diff --git a/playbook/roles/role-one/tasks/general-changes.yml b/playbook/roles/role-one/tasks/general-changes.yml index ae4f0c5..eef9a8a 100644 --- a/playbook/roles/role-one/tasks/general-changes.yml +++ b/playbook/roles/role-one/tasks/general-changes.yml @@ -1,11 +1,18 @@ --- -- name: General Changes | Install xfce4 - become: yes - apt: - name: xfce4 - state: latest - update_cache: yes +- name: General Changes | Check if xfce session is running + shell: + cmd: "echo $DESKTOP_SESSION" + register: session_running + +- name: General Changes | Debug session_running + debug: + var: session_running + +- name: General Changes | Stop execution if xfce session is not running + fail: + msg: "xfce session is not running" + when: session_running.stdout and session_running.stdout != 'xfce' - name: General Changes | Hide icons xfconf: @@ -59,9 +66,22 @@ dest: "{{ home_directory }}/Pictures" remote_src: yes +- name: General Changes | Get propery name for setting wallpaper + shell: + cmd: "xfconf-query -c xfce4-desktop -l | grep 'last-image$'" + register: wallpaper_property + +- name: Debug | Debug wallpaper_property + debug: + var: wallpaper_property + +- name: Debug | Debug wallpaper_property.stdout_lines + debug: + var: wallpaper_property.stdout_lines[0] + - name: General Changes | Change wallpaper xfconf: channel: "xfce4-desktop" - property: "/backdrop/screen0/monitor0/workspace0/last-image" - value_type: "string" + property: "{{ wallpaper_property.stdout_lines[0] }}" + value_type: string value: "{{ home_directory }}/Pictures/wallpapers/2560x1440.png"