feat(sway): add sway systemd trigger
This commit is contained in:
parent
43daa9a5e6
commit
5055fefcf8
4 changed files with 23 additions and 0 deletions
11
ansible/roles/sway/tasks/main.yaml
Normal file
11
ansible/roles/sway/tasks/main.yaml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
- name: Add sway systemd target
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "systemd/targets/sway-session.target"
|
||||||
|
dest: /etc/systemd/user/sway-session.target
|
||||||
|
|
||||||
|
- name: Add sway config
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "sway_systemd_trigger_target"
|
||||||
|
dest: /etc/sway/config.d/10-systemd-target
|
2
ansible/templates/sway_systemd_trigger_target
Normal file
2
ansible/templates/sway_systemd_trigger_target
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
exec "systemctl --user import-environment {,WAYLAND_}DISPLAY SWAYSOCK; systemctl --user start sway-session.target"
|
||||||
|
exec swaymsg -t subscribe '["shutdown"]' && systemctl --user stop sway-session.target
|
6
ansible/templates/systemd/targets/sway-session.target
Normal file
6
ansible/templates/systemd/targets/sway-session.target
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[Unit]
|
||||||
|
Description=sway compositor session
|
||||||
|
Documentation=man:systemd.special(7)
|
||||||
|
BindsTo=graphical-session.target
|
||||||
|
Wants=graphical-session-pre.target
|
||||||
|
After=graphical-session-pre.target
|
|
@ -152,6 +152,10 @@
|
||||||
community.general.pacman:
|
community.general.pacman:
|
||||||
name: "{{ (lookup('file', 'arch_packages.json') | from_json)['native'] }}" # the python script will return a list of packages
|
name: "{{ (lookup('file', 'arch_packages.json') | from_json)['native'] }}" # the python script will return a list of packages
|
||||||
|
|
||||||
|
- name: Install sway
|
||||||
|
include_role:
|
||||||
|
name: sway
|
||||||
|
|
||||||
# DOTS
|
# DOTS
|
||||||
- name: Clone dots file
|
- name: Clone dots file
|
||||||
git:
|
git:
|
||||||
|
|
Loading…
Reference in a new issue