From 40b3eaba12adede0162792cef85d88d44950eee1 Mon Sep 17 00:00:00 2001 From: marc Date: Wed, 4 Dec 2024 15:45:20 +0100 Subject: [PATCH] Added notification center --- modules/desktop/grapheio.nix | 6 ++- modules/desktop/tools/swaync.nix | 63 ++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 modules/desktop/tools/swaync.nix diff --git a/modules/desktop/grapheio.nix b/modules/desktop/grapheio.nix index c6dee87..2012a6d 100644 --- a/modules/desktop/grapheio.nix +++ b/modules/desktop/grapheio.nix @@ -57,10 +57,12 @@ in hyprlock.enable = true; # Status bars eww.enable = true; - # Launcher - rofi.enable = true; # Wallpapper hyprpaper.enable = true; + # Launcher + rofi.enable = true; + # Notification center + swaync.enable = true; }; }; diff --git a/modules/desktop/tools/swaync.nix b/modules/desktop/tools/swaync.nix new file mode 100644 index 0000000..fac48f8 --- /dev/null +++ b/modules/desktop/tools/swaync.nix @@ -0,0 +1,63 @@ +{ inputs, config, lib, pkgs, ... }: + +let + cfg = config.samfelag.modules.desktop.tools.swaync; + hyprCfg = config.samfelag.modules.desktop.wm.hyprland; +in { + + options.samfelag.modules.desktop.tools.swaync = with lib; { + enable = mkEnableOption "Sway Notification Center"; + }; + + config = lib.mkIf cfg.enable { + + environment.systemPackages = with pkgs; [ + libnotify + swaynotificationcenter + ]; + + hm.services.swaync = { + enable = true; + settings = { + }; + style = '' + * { + font-family: Iosevka; + } + + .notification { + padding: 4px 4px 0px 4px; + background-color: #${config.colorScheme.palette.base00}; + color: #${config.colorScheme.palette.base05}; + } + + .summary { + } + + .body { + } + + .control-center { + margin: 20px; + opacity: 0.95; + background-color: #${config.colorScheme.palette.base01}; + color: #${config.colorScheme.palette.base05}; + } + ''; + }; + + # - Execute on startup ----------------------- + + hm.wayland.windowManager.hyprland.settings = lib.mkIf hyprCfg.enable { + exec-once = [ + "swaync" + ]; + + bind = [ + # Notification center + "${hyprCfg.mod}, n, exec, swaync-client -t -sw" + ]; + }; + + }; +}