From 8eca740ad3c999db9c84fb70f1f519a53a3227e7 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Tue, 28 May 2024 22:02:40 +0200 Subject: [PATCH] Enable swaync only on sway --- home/modules/linux/graphical/wayland.nix | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/home/modules/linux/graphical/wayland.nix b/home/modules/linux/graphical/wayland.nix index 96ca229..6e2c648 100644 --- a/home/modules/linux/graphical/wayland.nix +++ b/home/modules/linux/graphical/wayland.nix @@ -5,25 +5,13 @@ let swaync = pkgs.swaynotificationcenter; in with lib; mkIf (config.linux.graphical.type == "wayland") { - home.packages = [ swaync ]; - wayland.windowManager.sway.config = { - startup = [ - { command = "swaync"; } - ]; - }; - xdg.configFile = { - "swaync/config.json" = { - text = builtins.toJSON { - widgets = [ "inhibitors" "title" "dnd" "mpris" "notifications" ]; - scripts = { }; - }; - onChange = "swaync-client -R"; - }; - "swaync/style.css" = { - source = ./swaync.css; - onChange = "swaync-client -rs"; - }; + services.swaync = { + enable = true; + settings.widgets = [ "inhibitors" "title" "dnd" "mpris" "notifications" ]; + style = ./swaync.css; }; + systemd.user.services.swaync.Install.WantedBy = lib.mkForce [ "sway-session.target" ]; + systemd.user.services.swaync.Unit.PartOf = lib.mkForce [ "sway-session.target" ]; programs.my-sway.waybar = { extraSettings = {