1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-01 04:23:34 +02:00

sway: unfail units before starting session target

Sometimes services can fail. Failed services will generally not be
restarted by systemd. To start previously failed services we can
just reset their failed state before starting our session target.

GNOME and Plasma do the same thing.

See: https://github.com/alebastr/sway-systemd/pull/11
This commit is contained in:
novenary 2024-03-07 18:57:22 +02:00
parent 384ffe30d9
commit 2b31e3fa03
11 changed files with 11 additions and 11 deletions

View File

@ -311,7 +311,7 @@ let
)
else
[ ]) ++ (optional cfg.systemd.enable ''
exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"'')
exec "systemctl --user reset-failed; ${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"'')
++ (optional (!cfg.xwayland) "xwayland disable") ++ [ cfg.extraConfig ]));
defaultSwayPackage = pkgs.sway.override {

View File

@ -108,4 +108,4 @@ bar {
}
}
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec "systemctl --user reset-failed; /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"

View File

@ -107,5 +107,5 @@ bar {
}
}
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec "systemctl --user reset-failed; /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec_always pkill flashfocus; flasfocus &

View File

@ -105,4 +105,4 @@ bar {
}
}
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec "systemctl --user reset-failed; /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"

View File

@ -83,4 +83,4 @@ mode "resize" {
bindsym l resize grow width 10 px
}
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec "systemctl --user reset-failed; /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"

View File

@ -83,4 +83,4 @@ mode "resize" {
bindsym l resize grow width 10 px
}
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec "systemctl --user reset-failed; /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"

View File

@ -117,4 +117,4 @@ bar {
}
}
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec "systemctl --user reset-failed; /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"

View File

@ -105,4 +105,4 @@ bar {
}
}
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec "systemctl --user reset-failed; /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"

View File

@ -105,4 +105,4 @@ bar {
}
}
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec "systemctl --user reset-failed; /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"

View File

@ -104,4 +104,4 @@ bar {
}
}
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec "systemctl --user reset-failed; /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"

View File

@ -110,4 +110,4 @@ workspace "ABC" output "DP"
workspace "3: Test" output "HDMI"
workspace "!"§$%&/(){}[]=?\*#<>-_.:,;²³" output "DVI"
workspace "Multiple" output "DVI" "HDMI" "DP"
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"
exec "systemctl --user reset-failed; /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target; swaymsg -mt subscribe '[]'; systemctl --user stop sway-session.target"