Make sway work on the same principles (no more waybar manual restarts ;D)

This commit is contained in:
Natsu Kagami 2025-01-17 11:18:11 +01:00
parent 26df6113e7
commit 379f9e6027
Signed by: nki
GPG key ID: 55A032EB38B49ADB
3 changed files with 34 additions and 10 deletions

View file

@ -92,7 +92,9 @@ in
};
config.systemd.user.targets.sway-session = mkIf cfg.enable {
Unit.Before = [ "tray.target" "xwayland.target" ];
Unit.Before = [ "tray.target" "xwayland.target" "xdg-desktop-portal.service" "xdg-desktop-autostart.target" ];
Unit.Upholds = [ "waybar.service" ];
Unit.Wants = [ "xdg-desktop-autostart.target" ];
};
# Enable waybar
@ -113,10 +115,10 @@ in
] ++ lib.optionals osConfig.services.desktopManager.plasma6.enable [
"XDG_MENU_PREFIX"
];
systemd.extraCommands = options.wayland.windowManager.sway.systemd.extraCommands.default
++ [
"systemctl --user restart xdg-desktop-portal.service"
];
# systemd.extraCommands = options.wayland.windowManager.sway.systemd.extraCommands.default
# ++ [
# "systemctl --user restart xdg-desktop-portal.service"
# ];
checkConfig = false; # Not working atm
config = {
@ -145,10 +147,10 @@ in
menu = "${pkgs.dmenu}/bin/dmenu_path | ${pkgs.bemenu}/bin/bemenu | ${pkgs.findutils}/bin/xargs swaymsg exec --";
# Startup
startup = [
# Dex for autostart
{ command = "${pkgs.dex}/bin/dex -ae sway"; }
# Waybar
{ command = "systemctl --user restart waybar"; always = true; }
# # Dex for autostart
# { command = "${pkgs.dex}/bin/dex -ae sway"; }
# # Waybar
# { command = "systemctl --user restart waybar"; always = true; }
# IME
{ command = "fcitx5"; }
];