-
-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyprland session target example #5648
Conversation
I've been thinking about adding an |
For A more elegant way is to write an |
Also, related sway discussion swaywm/sway#5160. I believe the first point you suggested might be the way to go. Additionally, distro packagers can patch https://github.com/hyprwm/Hyprland/blob/main/example/hyprland.desktop to add |
9b00957
to
c3ec16f
Compare
I agree, the first solution is the most portable one. However, I think is a good thing to provide this
|
7110a04
to
25aec3a
Compare
fb471b8
to
1237732
Compare
Put in another repository. |
According to this you should run So a better option would be: |
Added here. |
What I meant, at least according to that wiki page, is that the two commands should be executed one after the other. This way, the target and all units that depend on it will inherit the full environment. If you use two different exec-once, there is a chance that the second command will finish before the first one, effectively inheriting just part of the environment or none at all. So the preferred way would be like you did on your first commit |
Fixed in the README. |
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