-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is much more robust than starting the session from the compositor config. It will also become the upstream-sanctioned method to start a hyprland session with proper systemd integration: hyprwm/Hyprland#8339
- Loading branch information
Showing
1 changed file
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ in | |
|
||
services.displayManager.defaultSession = | ||
if this.hypr.enable | ||
then "hyprland" | ||
then "Hyprland-uwsm" | ||
else if this.tablet | ||
then "gnome" | ||
else "none+i3"; | ||
|
@@ -91,11 +91,13 @@ in | |
''; | ||
|
||
programs.hyprland.enable = this.hypr.enable; | ||
systemd.user.targets.hypr-session = lib.mkIf this.hypr.enable { | ||
bindsTo = [ "graphical-session.target" ]; | ||
wants = [ "graphical-session-pre.target" ]; | ||
after = [ "graphical-session-pre.target" ]; | ||
|
||
programs.uwsm.enable = true; | ||
programs.uwsm.waylandCompositors.Hyprland = { | ||
binPath = lib.getExe config.programs.hyprland.package; | ||
prettyName = "Hyprland"; | ||
}; | ||
|
||
systemd.user.services.hypridle = lib.mkIf this.hypr.enable { | ||
serviceConfig = { | ||
ExecStart = lib.getExe config.services.hypridle.package; | ||
|
@@ -107,24 +109,27 @@ in | |
procps | ||
swaylock | ||
]; | ||
partOf = [ "graphical-session.target" ]; | ||
after = [ "graphical-session.target" ]; | ||
wantedBy = [ "hypr-session.target" ]; | ||
wantedBy = [ "[email protected]" ]; | ||
after = [ "[email protected]" ]; # TODO should this be [email protected] instead? | ||
before = [ "[email protected]" ]; | ||
partOf = [ "[email protected]" ]; | ||
}; | ||
|
||
# A second hypridle daemon that activates power savings after 2s of idle | ||
systemd.user.services.hypridle-power = lib.mkIf this.hypr.hypridle-power { | ||
serviceConfig = { | ||
# Quiet because I don't care about logging these actions and they're very frequent | ||
ExecStart = "${lib.getExe config.services.hypridle.package} -c ${./hypridle-power.conf} --quiet"; | ||
}; | ||
path = [ config.services.power-profiles-daemon.package ]; | ||
partOf = [ "graphical-session.target" ]; | ||
wantedBy = [ "wayland-session@Hyprland.target" ]; | ||
after = [ | ||
"graphical-session.target" | ||
"[email protected]" | ||
# Let the regular hypridle register itself first to avoid any issues/races | ||
"hypridle.service" | ||
]; | ||
wantedBy = [ "hypr-session.target" ]; | ||
before = [ "[email protected]" ]; | ||
partOf = [ "[email protected]" ]; | ||
}; | ||
assertions = [ | ||
{ | ||
|