From 3d5908613b0d3286668e0e0bd4a9086c68587cd5 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sat, 11 Nov 2023 23:20:18 +0100 Subject: [PATCH] Add wallpaper --- playbooks/sway.yaml | 18 ++++++++++++++++++ templates/sway_config.j2 | 3 +-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/playbooks/sway.yaml b/playbooks/sway.yaml index 80f0208..99003ac 100644 --- a/playbooks/sway.yaml +++ b/playbooks/sway.yaml @@ -2,6 +2,7 @@ - name: Set up sway vars: uid: "{{ lookup('env','USER') }}" + wallpaper_path: /home/{{ uid }}/.config/wallpaper/savannah-landscape-with-acacia-trees.jpeg hosts: localhost connection: local become: false @@ -21,6 +22,7 @@ owner: "{{ uid }}" group: "{{ uid }}" mode: '0640' + notify: Reload sway - name: Create waybar dir ansible.builtin.file: dest: "/home/{{ uid }}/.config/waybar" @@ -32,3 +34,19 @@ owner: "{{ uid }}" group: "{{ uid }}" mode: '0640' + notify: Reload sway + - name: Create wallpaper dir + ansible.builtin.file: + dest: /home/{{ uid }}/.config/wallpaper + state: directory + # Image by upklyak on Freepik + # https://www.freepik.com/free-vector/savannah-landscape-with-acacia-trees-night-vector-cartoon-illustration-african-savanna-with-full-moon-stars-dark-sky-concept-safari-vacation-trip-travel_25694514.htm + - name: Setup wall paper + ansible.builtin.copy: + dest: '{{ wallpaper_path }}' + src: ../data/savannah-landscape-with-acacia-trees.jpeg + notify: Reload sway + handlers: + - name: Reload sway + ansible.builtin.command: + cmd: swaymsg reload diff --git a/templates/sway_config.j2 b/templates/sway_config.j2 index 52d3492..8253bdf 100644 --- a/templates/sway_config.j2 +++ b/templates/sway_config.j2 @@ -30,7 +30,7 @@ include /etc/sway/config-vars.d/* ### Output configuration # # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) -output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill +output * bg {{ wallpaper_path }} fill # # Example configuration: # @@ -244,7 +244,6 @@ exec_always { } exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway - bindsym $mod+Shift+s mode $screenshot_mode mode $screenshot_mode { # Screenshots: