From 81ccc67c60d7c02b9bdeb8b0d7c6a956de4b08ef Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Sun, 16 Jul 2023 15:15:38 +0200 Subject: [PATCH] compositor: Fix starting graphical programs on launch --- modules/graphical/compositor/default.nix | 12 +++++++++--- modules/graphical/pass/default.nix | 7 ++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/graphical/compositor/default.nix b/modules/graphical/compositor/default.nix index 61d85671..16195313 100644 --- a/modules/graphical/compositor/default.nix +++ b/modules/graphical/compositor/default.nix @@ -153,7 +153,7 @@ let configure_touchpads scroll-method two-finger ${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XCURSOR_SIZE - systemctl --user start graphical-session.target + systemctl --user start river-session.target ''; in { @@ -396,7 +396,7 @@ in services = { kanshi = { enable = true; - systemdTarget = "graphical-session.target"; + systemdTarget = "river-session.target"; profiles = { "home-undocked" = { outputs = [ @@ -428,7 +428,7 @@ in }; swayidle = { enable = true; - systemdTarget = "graphical-session.target"; + systemdTarget = "river-session.target"; events = [{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; }]; timeouts = [ { timeout = 150; command = "${pkgs.wlopm}/bin/wlopm --off '*'"; resumeCommand = "${pkgs.wlopm}/bin/wlopm --on '*'"; } @@ -436,6 +436,12 @@ in ]; }; }; + systemd.user.targets.river-session.Unit = { + Description = "river compositor session"; + BindsTo = [ "graphical-session.target" ]; + Wants = [ "graphical-session-pre.target" ]; + After = [ "graphical-session-pre.target" ]; + }; xdg.configFile."river/init" = { source = river-init; onChange = '' diff --git a/modules/graphical/pass/default.nix b/modules/graphical/pass/default.nix index 48a5b2b5..eedae2b1 100644 --- a/modules/graphical/pass/default.nix +++ b/modules/graphical/pass/default.nix @@ -27,14 +27,15 @@ systemd.user.services.keepassxc = { Unit = { Description = "KeepassXC startup"; - PartOf = [ "graphical-session.target" ]; - After = [ "graphical-session.target" ]; + PartOf = [ "river-session.target" ]; + Wants = [ "waybar.service" ]; + After = [ "river-session.target" "waybar.service" ]; }; Service = { ExecStart = "${pkgs.keepassxc}/bin/keepassxc"; Restart = "always"; }; - Install.WantedBy = [ "graphical-session.target" ]; + Install.WantedBy = [ "river-session.target" ]; }; }; };