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
${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 = ''

View file

@ -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" ];
};
};
};