From ed0d1e41d636bea8b1aea398b2f33a75128c2793 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 18 Jan 2025 18:44:00 -0500 Subject: [PATCH] Add a notification daemon. --- nix/configuration/roles/sway/default.nix | 1 + nix/configuration/roles/sway/notification.nix | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 nix/configuration/roles/sway/notification.nix diff --git a/nix/configuration/roles/sway/default.nix b/nix/configuration/roles/sway/default.nix index e6621c0..74faeb5 100644 --- a/nix/configuration/roles/sway/default.nix +++ b/nix/configuration/roles/sway/default.nix @@ -263,6 +263,7 @@ in ./lockscreen.nix ./screenshot.nix ./force_focus.nix + ./notification.nix ]; options.me.swayIncludes = lib.mkOption { diff --git a/nix/configuration/roles/sway/notification.nix b/nix/configuration/roles/sway/notification.nix new file mode 100644 index 0000000..ae2f40c --- /dev/null +++ b/nix/configuration/roles/sway/notification.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + notification_sway_config = pkgs.writeTextFile { + name = "notification.conf"; + text = + builtins.replaceStrings + [ "@mako@" "@makoctl@" ] + [ "${pkgs.mako}/bin/mako" "${pkgs.mako}/bin/makoctl" ] + '' + bindsym $mod+Escape exec @makoctl@ dismiss + bindsym $mod+Shift+Escape exec @makoctl@ invoke + + # Notifications + exec @mako@ + ''; + }; +in +{ + imports = [ ]; + + config = lib.mkIf config.me.graphical { + me.swayIncludes = [ + notification_sway_config + ]; + }; +}