~sumner/home-manager-config

4cbfafdac92471226a5e83315434b2166d094013 — Sumner Evans 8 months ago bcc1991
trying to unify dunst/mako
3 files changed, 68 insertions(+), 54 deletions(-)

M services/wayland.nix
M services/window-manager.nix
M services/xorg.nix
M services/wayland.nix => services/wayland.nix +0 -18
@@ 32,24 32,6 @@ in
      groupBy = "app-name,summary";
      sort = "-priority";
      width = 400;

      # Colors
      backgroundColor = "#191311CC";
      borderColor = "#5B8234";
      textColor = "#5B8234";

      extraConfig = ''
        [urgency=low]
        border-color=#777777
        text-color=#777777
        default-timeout=4000

        [urgency=high]
        border-color=#B7472A
        text-color=#B7472A
        background-color=#191311CC
        default-timeout=12000
      '';
    };

    # wayland.windowManager.sway.enable = true;

M services/window-manager.nix => services/window-manager.nix +68 -15
@@ 3,6 3,39 @@
  terminal = "${pkgs.alacritty}/bin/alacritty";
  waylandCfg = config.wayland;
  xorgCfg = config.xorg;

  redshiftGammastepCfg = {
    enable = true;
    provider = "geoclue2";
    tray = true;

    temperature = {
      day = 5500;
      night = 4000;
    };
  };
  notificationColorConfig = {
    urgency_low = {
      frame_color = "#777777";
      foreground = "#777777";
      background = "#191311";
      timeout = 4;
    };

    urgency_normal = {
      frame_color = "#5B8234";
      foreground = "#5B8234";
      background = "#191311";
      timeout = 8;
    };

    urgency_critical = {
      frame_color = "#B7472A";
      foreground = "#B7472A";
      background = "#191311";
      timeout = 12;
    };
  };
in
{
  config = mkIf (waylandCfg.enable || xorgCfg.enable) {


@@ 19,22 52,42 @@ in
      TERMINAL = "${terminal}";
    };

    services = let
      redshiftGammastepCfg = {
        enable = true;
        provider = "geoclue2";
        tray = true;
    services = {
      # Redshift/gammastep
      gammastep = mkIf waylandCfg.enable redshiftGammastepCfg;
      redshift = mkIf xorgCfg.enable redshiftGammastepCfg;

        temperature = {
          day = 5500;
          night = 4000;
        };
      };
    in
      {
        gammastep = mkIf waylandCfg.enable redshiftGammastepCfg;
        redshift = mkIf xorgCfg.enable redshiftGammastepCfg;
      };
      # Dunst
      dunst.settings = mkIf xorgCfg.enable notificationColorConfig;
    };

    # Mako
    programs.mako.extraConfig = mkIf waylandCfg.enable (
      generators.toINI {} (
        mapAttrs' (
          name: val: nameValuePair
            (builtins.replaceStrings "_" "=" name)
            (
              mapAttrs' (
                k: v:
                  nameValuePair
                    (
                      if k == "timeout" then "default-timeout"
                      else if k == "frame_color" then "border-color"
                      else if k == "foreground" then "text-color"
                      else if k == "background" then "background-color"
                      else k
                    )
                    (
                      if k == "timeout" then v * 1000
                      else if k == "background" then v + "CC"
                      else v
                    )
              ) val
            )
        ) notificationColorConfig
      )
    );

    gtk = {
      enable = true;

M services/xorg.nix => services/xorg.nix +0 -21
@@ 46,27 46,6 @@ in
          line_height = 3;
          format = "<b>%s</b>\\n%b\\n%p";
        };

        urgency_low = {
          frame_color = "#3B7C87";
          foreground = "#3B7C87";
          background = "#191311";
          timeout = 4;
        };

        urgency_normal = {
          frame_color = "#5B8234";
          foreground = "#5B8234";
          background = "#191311";
          timeout = 6;
        };

        urgency_critical = {
          frame_color = "#B7472A";
          foreground = "#B7472A";
          background = "#191311";
          timeout = 8;
        };
      };
    };