diff --git a/Manual.org b/Manual.org index eb4a686..98d59f7 100644 --- a/Manual.org +++ b/Manual.org @@ -1602,6 +1602,11 @@ b'\xde\xad\xbe\xef' src: roles/yavdr-xorg/templates/systemd/user/tmux.service.j2 dest: '{{ vdr.home }}/.config/systemd/user/tmux.service' +- name: create wm-exit.service for the session + template: + src: roles/yavdr-xorg/templates/systemd/user/wm-exit.service.j2 + dest: '{{ vdr.home }}/.config/systemd/user/wm-exit.service' + - name: create detect-second-display.service for the session template: src: templates/systemd/user/detect-second-display.service.j2 @@ -2068,6 +2073,19 @@ ExecStart=/usr/bin/tmux new-session -s use-session -d ExecStop=/usr/bin/tmux kill-session -t %u Restart=always +[Install] +WantedBy=default.target +#+END_SRC +***** wm-exit.service +#+BEGIN_SRC conf :tangle roles/yavdr-xorg/templates/systemd/user/wm-exit.service.j2 :mkdirp yes :padline no +[Unit] +Description=exit window manager gracefully + +[Service] +ExecStart=/bin/true +ExecStop=/usr/bin/openbox --exit +RemainAfterExit=True + [Install] WantedBy=default.target #+END_SRC @@ -2082,7 +2100,7 @@ enabled_services=( "tmux.service" "detect-second-display.service" "openbox-second.service" "osd2web.service" "yavdr-frontend.service" "pulseaudio.socket" - "pulseaudio.service") + "pulseaudio.service" "wm-exit.service") disabled_services=() # enable configured services for the user session diff --git a/roles/yavdr-xorg/tasks/desktop-session.yml b/roles/yavdr-xorg/tasks/desktop-session.yml index 245e003..8f771c5 100644 --- a/roles/yavdr-xorg/tasks/desktop-session.yml +++ b/roles/yavdr-xorg/tasks/desktop-session.yml @@ -59,6 +59,11 @@ src: roles/yavdr-xorg/templates/systemd/user/tmux.service.j2 dest: '{{ vdr.home }}/.config/systemd/user/tmux.service' +- name: create wm-exit.service for the session + template: + src: roles/yavdr-xorg/templates/systemd/user/wm-exit.service.j2 + dest: '{{ vdr.home }}/.config/systemd/user/wm-exit.service' + - name: create detect-second-display.service for the session template: src: templates/systemd/user/detect-second-display.service.j2 diff --git a/roles/yavdr-xorg/templates/openbox/autostart.j2 b/roles/yavdr-xorg/templates/openbox/autostart.j2 index 3bc73f2..9a56396 100755 --- a/roles/yavdr-xorg/templates/openbox/autostart.j2 +++ b/roles/yavdr-xorg/templates/openbox/autostart.j2 @@ -7,7 +7,7 @@ enabled_services=( "tmux.service" "detect-second-display.service" "openbox-second.service" "osd2web.service" "yavdr-frontend.service" "pulseaudio.socket" - "pulseaudio.service") + "pulseaudio.service" "wm-exit.service") disabled_services=() # enable configured services for the user session