Преглед на файлове

replace current script based xsession invocation with a systemd based

systemd-xsession
Markus Katharina Brechtel преди 3 години
родител
ревизия
b647fd12ce
променени са 5 файла, в които са добавени 31 реда и са изтрити 13 реда
  1. +10
    -3
      tasks/i3.yaml
  2. +6
    -0
      tasks/x11.yaml
  3. +11
    -0
      templates/i3/i3wm.service.j2
  4. +3
    -0
      templates/x11/xsession.target.j2
  5. +1
    -10
      templates/x11/xsessionrc.j2

+ 10
- 3
tasks/i3.yaml Целия файл

@@ -19,7 +19,14 @@
path: ~/.config/i3blocks
state: directory

- name: i3blocks config
- name: i3wm graphical-session service
template:
src: i3/i3blocks.config.j2
dest: ~/.config/i3blocks/config
src: i3/i3wm.service.j2
dest: ~/.config/systemd/user/i3wm.service
notify: systemd daemon-reload

- name: i3wm graphical-session service enabled
systemd:
name: i3wm.service
enabled: true
scope: user

+ 6
- 0
tasks/x11.yaml Целия файл

@@ -22,6 +22,12 @@
dest: ~/.xsession.reload.fish
mode: 0755

- name: xsession systemd target
template:
src: x11/xsession.target.j2
dest: ~/.config/systemd/user/xsession.target
notify: systemd daemon-reload

- name: xsessionrc
template:
src: x11/xsessionrc.j2


+ 11
- 0
templates/i3/i3wm.service.j2 Целия файл

@@ -0,0 +1,11 @@
[Unit]
Description=i3 Window Manager
PartOf=graphical-session.target

[Service]
ExecStart=/usr/bin/i3
ExecStopPost=/bin/systemctl --user stop graphical-session.target
Restart=on-failure

[Install]
RequiredBy=xsession.target

+ 3
- 0
templates/x11/xsession.target.j2 Целия файл

@@ -0,0 +1,3 @@
[Unit]
Description=X session managed by systemd
BindsTo=graphical-session.target

+ 1
- 10
templates/x11/xsessionrc.j2 Целия файл

@@ -2,13 +2,4 @@

{{ansible_managed|comment}}

if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi

exec fish ~/.xsession.fish
exec systemctl --user start --wait xsession.target