feat(sway): add sway systemd trigger

This commit is contained in:
Matthieu Bessat 2024-07-09 12:51:06 +02:00
parent 43daa9a5e6
commit 5055fefcf8
4 changed files with 23 additions and 0 deletions

View 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

View 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

View 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

View file

@ -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: