diff --git a/defaults/main.yml b/defaults/main.yml index 56e5f82..cb9b79d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,7 +16,9 @@ sway__term_pkgs: - foot-themes sway__keyboard_settings: true sway__keyboard_lang: 'de' -sway__lock: 'swaylock --color 000000 --image /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png' +sway__lock: 'swaylock --color 00000000 && killall -9 cmatrix & foot -F cmatrix -a -L && exit' +sway__swaylock: | + color=000000ff sway__waybar: true sway__waybar_modules_left: ["sway/workspaces", "sway/mode", "sway/scratchpad"] sway__waybar_modules_center: ["sway/window"] diff --git a/tasks/config.yml b/tasks/config.yml index 898c342..cc4f748 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -34,6 +34,32 @@ label: "{{ swayusr.home }}/.config/sway/" when: sway__dynamic_names | bool +- name: Creates swaylock config directory if needed + become: true + ansible.builtin.file: + path: "{{ swayusr.home }}/.swaylock" + state: directory + mode: '0750' + owner: "{{ swayusr.user }}" + group: "{{ swayusr.user }}" + loop: "{{ sway__user_list | flatten(1) }}" + loop_control: + loop_var: swayusr + label: "{{ swayusr.home }}/.swaylock" + +- name: Deploy swaylock config file + become: true + ansible.builtin.template: + src: 'templates/swaylock.j2' + dest: "{{ swayusr.home }}/.swaylock/config" + mode: '0640' + owner: "{{ swayusr.user }}" + group: "{{ swayusr.user }}" + loop: "{{ sway__user_list | flatten(1) }}" + loop_control: + label: "{{ swayusr.home }}/.swaylock/config" + loop_var: swayusr + - name: Deploy sway config file become: true ansible.builtin.template: diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index a607b2f..022e5ac 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -21,6 +21,7 @@ - 'swayidle' - 'swayimg' - 'wdisplays' + - 'cmatrix' - name: Ensure font-awesome is installed ansible.builtin.apt: diff --git a/templates/swaylock.j2 b/templates/swaylock.j2 new file mode 100644 index 0000000..b2f73b8 --- /dev/null +++ b/templates/swaylock.j2 @@ -0,0 +1,3 @@ +# {{ ansible_managed }} +ignore-empty-password +{{ sway__swaylock }} diff --git a/vars/main.yml b/vars/main.yml index 64f381c..5434c49 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,3 +1,3 @@ --- -playbook_version_number: 8 # should be int +playbook_version_number: 9 # should be int playbook_version_path: 'role-roles-ansible.sway.version'