compositor: Fix starting graphical programs on launch

This commit is contained in:
Charlotte Van Petegem 2023-07-16 15:15:38 +02:00
parent 98ea7c2350
commit 81ccc67c60
No known key found for this signature in database
GPG key ID: 019E764B7184435A
2 changed files with 13 additions and 6 deletions

View file

@ -153,7 +153,7 @@ let
configure_touchpads scroll-method two-finger 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 ${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 in
{ {
@ -396,7 +396,7 @@ in
services = { services = {
kanshi = { kanshi = {
enable = true; enable = true;
systemdTarget = "graphical-session.target"; systemdTarget = "river-session.target";
profiles = { profiles = {
"home-undocked" = { "home-undocked" = {
outputs = [ outputs = [
@ -428,7 +428,7 @@ in
}; };
swayidle = { swayidle = {
enable = true; enable = true;
systemdTarget = "graphical-session.target"; systemdTarget = "river-session.target";
events = [{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; }]; events = [{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; }];
timeouts = [ timeouts = [
{ timeout = 150; command = "${pkgs.wlopm}/bin/wlopm --off '*'"; resumeCommand = "${pkgs.wlopm}/bin/wlopm --on '*'"; } { 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" = { xdg.configFile."river/init" = {
source = river-init; source = river-init;
onChange = '' onChange = ''

View file

@ -27,14 +27,15 @@
systemd.user.services.keepassxc = { systemd.user.services.keepassxc = {
Unit = { Unit = {
Description = "KeepassXC startup"; Description = "KeepassXC startup";
PartOf = [ "graphical-session.target" ]; PartOf = [ "river-session.target" ];
After = [ "graphical-session.target" ]; Wants = [ "waybar.service" ];
After = [ "river-session.target" "waybar.service" ];
}; };
Service = { Service = {
ExecStart = "${pkgs.keepassxc}/bin/keepassxc"; ExecStart = "${pkgs.keepassxc}/bin/keepassxc";
Restart = "always"; Restart = "always";
}; };
Install.WantedBy = [ "graphical-session.target" ]; Install.WantedBy = [ "river-session.target" ];
}; };
}; };
}; };