fix(nix-hm): ensure user services are launched with DE

This commit is contained in:
Price Hiller 2024-02-05 01:43:01 -06:00
parent 6b1981414b
commit edf34363aa
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
2 changed files with 35 additions and 3 deletions

View File

@ -185,9 +185,41 @@ in {
systemd.user = {
sessionVariables = config.home.sessionVariables;
targets.compositor = {
Unit = {
Description = "Unit for DE to launch";
ConditionEnvironment = [ "WAYLAND_DISPLAY" "DISPLAY" ];
};
};
services = {
opensnitch-ui.Unit.ConditionEnvironment = [ "WAYLAND_DISPLAY" ];
easyeffects.Unit.ConditionEnvironment = [ "WAYLAND_DISPLAY" ];
waybar = {
Install.WantedBy = [ "compositor.target" ];
Unit = {
PartOf = [ "compositor.target" ];
After = [ "compositor.target" ];
};
};
opensnitch-ui = {
Install.WantedBy = [ "compositor.target" ];
Unit = {
PartOf = [ "compositor.target" ];
After = [ "compositor.target" ];
};
};
easyeffects = {
Install.WantedBy = [ "compositor.target" ];
Unit = {
PartOf = [ "compositor.target" ];
After = [ "compositor.target" ];
};
};
cliphist = {
Install.WantedBy = [ "compositor.target" ];
Unit = {
PartOf = [ "compositor.target" ];
After = [ "compositor.target" ];
};
};
};
};
}

View File

@ -12,8 +12,8 @@ exec-once = blueman-applet
exec-once = slimbookbattery --minimize
exec = clight-gui --tray
exec = systemd-run --user -u wallpaper-manager ~/.config/hypr/scripts/init-wallpapers.bash || systemctl --user restart wallpaper-manager
exec-once = systemctl --user start compositor.target
exec-once = xwaylandvideobridge
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP QT_QPA_PLATFORMTHEME GTK_THEME
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP QT_QPA_PLATFORMTHEME GTK_THEME
exec-once = /usr/lib/polkit-kde-authentication-agent-1
exec-once = systemctl --user start compositor.target