Updated general changes

- Expects xfce to be installed and session is running
- Get property name before setting wallpaper because this property differs
This commit is contained in:
swapnil 2022-03-22 17:32:41 +05:30
parent 7ea4b88901
commit c1b253f0fe
1 changed files with 28 additions and 8 deletions

View File

@ -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"