mirror of
https://github.com/YaLTeR/niri.git
synced 2024-09-11 12:35:58 +03:00
Add and call niri-shutdown.target
Sometimes graphical-session.target lingers on after niri quits, leading to services not being started on a quick relogin. To work around this, add and run a systemd target that conflicts with graphical-session.target and forces its shutdown.
This commit is contained in:
parent
9eb5d5c22d
commit
f085384bc7
@ -84,6 +84,7 @@ assets = [
|
|||||||
{ source = "resources/niri.desktop", dest = "/usr/share/wayland-sessions/", mode = "644" },
|
{ source = "resources/niri.desktop", dest = "/usr/share/wayland-sessions/", mode = "644" },
|
||||||
{ source = "resources/niri-portals.conf", dest = "/usr/share/xdg-desktop-portal/", mode = "644" },
|
{ source = "resources/niri-portals.conf", dest = "/usr/share/xdg-desktop-portal/", mode = "644" },
|
||||||
{ source = "resources/niri.service", dest = "/usr/lib/systemd/user/", mode = "644" },
|
{ source = "resources/niri.service", dest = "/usr/lib/systemd/user/", mode = "644" },
|
||||||
|
{ source = "resources/niri-shutdown.target", dest = "/usr/lib/systemd/user/", mode = "644" },
|
||||||
]
|
]
|
||||||
[package.metadata.generate-rpm.requires]
|
[package.metadata.generate-rpm.requires]
|
||||||
alacritty = "*"
|
alacritty = "*"
|
||||||
|
@ -64,6 +64,7 @@ To do that, put files into the correct directories according to this table.
|
|||||||
| `resources/niri.desktop` | `/usr/share/wayland-sessions/` |
|
| `resources/niri.desktop` | `/usr/share/wayland-sessions/` |
|
||||||
| `resources/niri-portals.conf` | `/usr/share/xdg-desktop-portal/` |
|
| `resources/niri-portals.conf` | `/usr/share/xdg-desktop-portal/` |
|
||||||
| `resources/niri.service` | `/usr/lib/systemd/user/` |
|
| `resources/niri.service` | `/usr/lib/systemd/user/` |
|
||||||
|
| `resources/niri-shutdown.target` | `/usr/lib/systemd/user/` |
|
||||||
|
|
||||||
Doing this will make niri appear in GDM and, presumably, other display managers.
|
Doing this will make niri appear in GDM and, presumably, other display managers.
|
||||||
|
|
||||||
|
@ -40,5 +40,8 @@ fi
|
|||||||
# Start niri and wait for it to terminate.
|
# Start niri and wait for it to terminate.
|
||||||
systemctl --user --wait start niri.service
|
systemctl --user --wait start niri.service
|
||||||
|
|
||||||
|
# Force stop of grahical-session.target.
|
||||||
|
systemctl --user start --job-mode=replace-irreversibly niri-shutdown.target
|
||||||
|
|
||||||
# Unset environment that we've set.
|
# Unset environment that we've set.
|
||||||
systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
|
systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
|
||||||
|
7
resources/niri-shutdown.target
Normal file
7
resources/niri-shutdown.target
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Shutdown running niri session
|
||||||
|
DefaultDependencies=no
|
||||||
|
StopWhenUnneeded=true
|
||||||
|
|
||||||
|
Conflicts=graphical-session.target graphical-session-pre.target
|
||||||
|
After=graphical-session.target graphical-session-pre.target
|
Loading…
Reference in New Issue
Block a user