From 8ff5d9114967213806d63a7a4a15cc60584fd69f Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Tue, 29 Nov 2022 03:40:39 -0500 Subject: [PATCH] Custom wlogout layout to support custom lock setting. --- ansible/roles/sway/files/wlogout_layout | 36 +++++++++++++++++++ ansible/roles/sway/tasks/freebsd.yaml | 1 + ansible/roles/sway/tasks/peruser_freebsd.yaml | 20 +++++++++++ 3 files changed, 57 insertions(+) create mode 100644 ansible/roles/sway/files/wlogout_layout diff --git a/ansible/roles/sway/files/wlogout_layout b/ansible/roles/sway/files/wlogout_layout new file mode 100644 index 0000000..83f4163 --- /dev/null +++ b/ansible/roles/sway/files/wlogout_layout @@ -0,0 +1,36 @@ +{ + "label" : "lock", + "action" : "swaylock -c 000000", + "text" : "Lock", + "keybind" : "l" +} +{ + "label" : "hibernate", + "action" : "acpiconf -s 4", + "text" : "Hibernate", + "keybind" : "h" +} +{ + "label" : "logout", + "action" : "kill -9 -1", + "text" : "Logout", + "keybind" : "e" +} +{ + "label" : "shutdown", + "action" : "shutdown -p now", + "text" : "Shutdown", + "keybind" : "s" +} +{ + "label" : "suspend", + "action" : "zzz", + "text" : "Suspend", + "keybind" : "u" +} +{ + "label" : "reboot", + "action" : "shutdown -r now", + "text" : "Reboot", + "keybind" : "r" +} diff --git a/ansible/roles/sway/tasks/freebsd.yaml b/ansible/roles/sway/tasks/freebsd.yaml index 44b3d88..620e961 100644 --- a/ansible/roles/sway/tasks/freebsd.yaml +++ b/ansible/roles/sway/tasks/freebsd.yaml @@ -49,3 +49,4 @@ - src: launch_sway_freebsd.bash dest: /usr/local/bin/launch_sway + diff --git a/ansible/roles/sway/tasks/peruser_freebsd.yaml b/ansible/roles/sway/tasks/peruser_freebsd.yaml index e69de29..689f864 100644 --- a/ansible/roles/sway/tasks/peruser_freebsd.yaml +++ b/ansible/roles/sway/tasks/peruser_freebsd.yaml @@ -0,0 +1,20 @@ +- name: Create directories + file: + name: "{{ account_homedir.stdout }}/{{ item }}" + state: directory + mode: 0700 + owner: "{{ account_name.stdout }}" + group: "{{ group_name.stdout }}" + loop: + - ".config/wlogout" + +- name: Copy files + copy: + src: "files/{{ item.src }}" + dest: "{{ account_homedir.stdout }}/{{ item.dest }}" + mode: 0600 + owner: "{{ account_name.stdout }}" + group: "{{ group_name.stdout }}" + loop: + - src: wlogout_layout + dest: .config/wlogout/layout