Converted swaync to a home module

This commit is contained in:
alejandro-angulo 2024-08-02 20:01:03 -07:00
parent 4b83423f1c
commit 013c907a95
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
5 changed files with 49 additions and 45 deletions

View file

@ -26,5 +26,9 @@
git.enable = true; git.enable = true;
zsh.enable = true; zsh.enable = true;
}; };
services = {
swaync.enable = true;
};
}; };
} }

View file

@ -0,0 +1,26 @@
{
config,
lib,
pkgs,
namespace,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.services.swaync;
in {
options.${namespace}.services.swaync = {
enable = mkEnableOption "sway notification center";
};
config = mkIf cfg.enable {
home.packages = [pkgs.libnotify];
services.swaync = {
enable = true;
settings = {
widgets = ["title" "dnd" "notifications" "mpris"];
};
};
};
}

View file

@ -1,25 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.aa.desktop.addons.swaync;
in {
options.aa.desktop.addons.swaync = {
enable = lib.mkEnableOption "sway notification center";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [libnotify];
aa.home.extraOptions = {
services.swaync = {
enable = true;
settings = {
widgets = ["title" "dnd" "notifications" "mpris"];
};
};
};
};
}

View file

@ -141,25 +141,25 @@ in {
tooltip-format = "{essid} {signalStrength}%"; tooltip-format = "{essid} {signalStrength}%";
}; };
"custom/notification" = mkIf config.aa.desktop.addons.swaync.enable { # "custom/notification" = mkIf config.aa.desktop.addons.swaync.enable {
tooltip = false; # tooltip = false;
format = "{icon} {}"; # format = "{icon} {}";
format-icons = { # format-icons = {
notification = "<span foreground='red'><sup></sup></span>"; # notification = "<span foreground='red'><sup></sup></span>";
none = ""; # none = "";
dnd-notification = "<span foreground='red'><sup></sup></span>"; # dnd-notification = "<span foreground='red'><sup></sup></span>";
dnd-none = ""; # dnd-none = "";
inhibited-notification = "<span foreground='red'><sup></sup></span>"; # inhibited-notification = "<span foreground='red'><sup></sup></span>";
inhibited-none = ""; # inhibited-none = "";
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>"; # dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
dnd-inhibited-none = ""; # dnd-inhibited-none = "";
}; # };
return-type = "json"; # return-type = "json";
exec = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb"; # exec = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb";
on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"; # on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw";
on-click-right = "${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw"; # on-click-right = "${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw";
escape = true; # escape = true;
}; # };
tray = { tray = {
spacing = 10; spacing = 10;

View file

@ -42,7 +42,6 @@ in {
rofi.enable = true; rofi.enable = true;
swayidle.enable = true; swayidle.enable = true;
swaylock.enable = true; swaylock.enable = true;
swaync.enable = true;
waybar.enable = true; waybar.enable = true;
# TODO # TODO