Hyprland session target example #5648
Open
+5
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your PR, what does it fix/add?
A simple Hyprland user session target that automatically calls
graphical-session-pre.target
andgraphical-session.target
when launched bysystemctl --user
. A lot of Wayland applications usually ship their own user units that depends ongraphical-session.target
in order to be executed only when a graphical environment is running. Hyprland doesn't automatically ships its own session target so users have to explicitly execute installed systemd units withexec-once = systemctl --user start ...
without the ability of enabling/disabling them selectively without modifying each time the configuration file.For these reasons a lot of users prefer to manually create an
hyprland-session.target
unit file and start it withexec-once = systemctl --user start hyprland-session.target
(you can't directly startgraphical-session.target
viasystemctl
). But this approach has an important drawback: when you exit from Hyprland without logging out from your user session then neither the graphical session target nor all the unit services depending on it would stop. There are two possible ways to solve this:hyprland-session.target
in Hyprland code;hyprctl exit
is called elsewhere.For the moment I only provide a simple
hyprland-session.target
file which is not automatically installed by meson in order to avoid overwriting custom target units. In this way users and package managers can freely decide whenever use it or not.Is it ready for merging, or does it need work?
Automatically works