Use conditions in template instead of lineinfile

This commit is contained in:
flyingscorpio@clevo 2022-06-12 12:48:47 +02:00
parent 78c284166d
commit 7801b7bda4
2 changed files with 6 additions and 22 deletions

View file

@ -121,22 +121,3 @@
become: true
shell: cd {{ ansible_facts.user_dir }}/.git_clones/i3blocks && make install
when: ansible_facts['distribution'] == 'Debian'
- name: Uncomment wallpaper lines for clitip or xkcd
lineinfile:
path: ~/.config/i3/config
regexp: "{{ item }}"
line: '\1'
backrefs: true
with_items:
- '^#(exec .*wallpaper\.sh$)'
- '^#(exec .* hsetroot -center .*\.png$)'
when: wallpaper_type != 'fixed'
- name: Uncomment wallpaper lines for fixed
lineinfile:
path: ~/.config/i3/config
regexp: '^#(exec .* hsetroot -cover .*current$)'
line: '\1'
backrefs: true
when: wallpaper_type == 'fixed'

View file

@ -9,9 +9,12 @@ font pango: Noto Sans 9
floating_modifier $super
#autostart
#exec --no-startup-id ~/.local/bin/{{ wallpaper_type }}_wallpaper.sh
#exec --no-startup-id hsetroot -center ~/Pictures/wallpapers/{{ wallpaper_type }}-wallpaper.png
#exec --no-startup-id hsetroot -cover ~/Pictures/wallpapers/current
{% if wallpaper_type == "fixed" %}
exec --no-startup-id hsetroot -cover ~/Pictures/wallpapers/current
{% else %}
exec --no-startup-id ~/.local/bin/{{ wallpaper_type }}_wallpaper.sh
exec --no-startup-id hsetroot -center ~/Pictures/wallpapers/{{ wallpaper_type }}-wallpaper.png
{% endif %}
exec --no-startup-id xsettingsd &
exec --no-startup-id picom -b --config ~/.config/picom.conf