Add and call niri-shutdown.target
Browse files at this commitf085384bc70fb1ac5d19bcb71547b87bb475ee8cParent: 9eb5d5c4 changed files +12 -0
- Cargo.toml +1 -0
- README.md +1 -0
- resources/niri-session +3 -0
- resources/niri-shutdown.target +7 -0
Cargo.tomlmodified+1 -0
| @@ -84,6 +84,7 @@ assets = [ | ||
| 84 | 84 | { source = "resources/niri.desktop", dest = "/usr/share/wayland-sessions/", mode = "644" }, |
| 85 | 85 | { source = "resources/niri-portals.conf", dest = "/usr/share/xdg-desktop-portal/", mode = "644" }, |
| 86 | 86 | { source = "resources/niri.service", dest = "/usr/lib/systemd/user/", mode = "644" }, |
| 87 | + { source = "resources/niri-shutdown.target", dest = "/usr/lib/systemd/user/", mode = "644" }, | |
| 87 | 88 | ] |
| 88 | 89 | [package.metadata.generate-rpm.requires] |
| 89 | 90 | alacritty = "*" |
README.mdmodified+1 -0
| @@ -64,6 +64,7 @@ To do that, put files into the correct directories according to this table. | ||
| 64 | 64 | | `resources/niri.desktop` | `/usr/share/wayland-sessions/` | |
| 65 | 65 | | `resources/niri-portals.conf` | `/usr/share/xdg-desktop-portal/` | |
| 66 | 66 | | `resources/niri.service` | `/usr/lib/systemd/user/` | |
| 67 | +| `resources/niri-shutdown.target` | `/usr/lib/systemd/user/` | | |
| 67 | 68 | |
| 68 | 69 | Doing this will make niri appear in GDM and, presumably, other display managers. |
| 69 | 70 |
resources/niri-sessionmodified+3 -0
| @@ -40,5 +40,8 @@ fi | ||
| 40 | 40 | # Start niri and wait for it to terminate. |
| 41 | 41 | systemctl --user --wait start niri.service |
| 42 | 42 | |
| 43 | +# Force stop of grahical-session.target. | |
| 44 | +systemctl --user start --job-mode=replace-irreversibly niri-shutdown.target | |
| 45 | + | |
| 43 | 46 | # Unset environment that we've set. |
| 44 | 47 | systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP |
resources/niri-shutdown.targetadded+7 -0
| @@ -0,0 +1,7 @@ | ||
| 1 | +[Unit] | |
| 2 | +Description=Shutdown running niri session | |
| 3 | +DefaultDependencies=no | |
| 4 | +StopWhenUnneeded=true | |
| 5 | + | |
| 6 | +Conflicts=graphical-session.target graphical-session-pre.target | |
| 7 | +After=graphical-session.target graphical-session-pre.target |