From 9922176f176cb50f73a1f38e2c1299f9d177e024 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Tue, 17 Nov 2026 12:30:57 -0500 Subject: [PATCH] add swaync config for mobile --- modules/mobile/niri.nix | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/modules/mobile/niri.nix b/modules/mobile/niri.nix index ea9fb42..92958a5 100644 --- a/modules/mobile/niri.nix +++ b/modules/mobile/niri.nix @@ -43,6 +43,44 @@ let ${lib.getExe pkgs.niri} msg action power-off-monitors exec ${config.systemd.package}/bin/systemctl suspend ''; + + swaync = pkgs.swaynotificationcenter; + + swayncStyle = pkgs.writeText "swaync.css" '' + @import url("file://${swaync}/etc/xdg/swaync/style.css"); + + :root { + --noti-bg-focus: transparent; + --noti-border-color: transparent; + --notification-shadow: none; + --border-radius: 16px; + --notification-icon-size: 48px; + --font-size-summary: 14px; + --font-size-body: 14px; + } + + .notification-row .notification-background .notification { + background: shade(@theme_bg_color, 1.25); + } + + .notification-row .notification-background .notification .notification-default-action .notification-content { + padding: 6px; + } + + .notification-row .notification-background .notification .notification-default-action .notification-content .text-box .body { + opacity: 0.8; + } + ''; + + swayncConfig = (pkgs.formats.json { }).generate "swaync.json" ( + lib.importJSON "${swaync}/etc/xdg/swaync/config.json" + // { + positionX = "center"; + positionY = "top"; + notification-window-width = 344; + ignore-gtk-theme = false; + } + ); in { nixpkgs.overlays = [ @@ -117,6 +155,7 @@ in spawn-at-startup "${lib.getExe pkgs.app-grid}" spawn-at-startup "${lib.getExe stevia}" spawn-at-startup "${lib.getExe' pkgs.swayosd "swayosd-server"}" "--style" "${swayosdStyle}" + spawn-at-startup "${lib.getExe' swaync "swaync"}" "--style" "${swayncStyle}" "--config" "${swayncConfig}" // We log in automatically, so lock straight away. spawn-at-startup "${config.quad.lock}" spawn-at-startup "${lib.getExe pkgs.hypridle}" "--config" "${hypridleConfig}"