Skip to content

Commit

Permalink
improve swaylock config
Browse files Browse the repository at this point in the history
  • Loading branch information
DO1JLR committed Jul 25, 2024
1 parent 2100e20 commit a0c14b4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
4 changes: 3 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
26 changes: 26 additions & 0 deletions tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- 'swayidle'
- 'swayimg'
- 'wdisplays'
- 'cmatrix'

- name: Ensure font-awesome is installed
ansible.builtin.apt:
Expand Down
3 changes: 3 additions & 0 deletions templates/swaylock.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# {{ ansible_managed }}
ignore-empty-password
{{ sway__swaylock }}
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit a0c14b4

Please sign in to comment.