DEVELOPMENT ENVIRONMENT

~liljamo/nix-arta

f5717a90fb2d53cf538a0941f74633cd3bd7c250 — Jonni Liljamo 7 days ago 00f5526
feat: waybar
1 files changed, 137 insertions(+), 0 deletions(-)

A modules/home/waybar.nix
A modules/home/waybar.nix => modules/home/waybar.nix +137 -0
@@ 0,0 1,137 @@
{
  flake.modules.homeManager.waybar = {
    config,
    lib,
    ...
  }: let
    cfg = config.arta.waybar;
  in {
    options.arta.waybar = {
      extraConfig = lib.mkOption {
        type = lib.types.lazyAttrsOf lib.types.unspecified;
        default = {};
      };
    };

    config = {
      programs.waybar = {
        enable = true;
        settings = [
          (lib.mkMerge [
            {
              layer = "top";
              position = "top";
              height = 20;

              "custom/sep" = {
                format = "|";
                interval = "once";
                tooltip = false;
              };

              "backlight" = {
                format = "bl {percent}%";
                tooltip = false;
              };

              "battery" = {
                format = "bat {capacity}%";
                format-charging = "bat+ {capacity}%";
                format-discharging = "bat- {capacity}%";
                tooltip = false;
              };

              "bluetooth" = {
                format = "bt {status}";
                on-click = "foot bluetui";
                tooltip = false;
              };

              "clock" = {
                format = "{:%F %H:%M}";
                tooltip = false;
              };

              "disk" = {
                format = "avail {total}";
                tooltip = false;
              };

              "hyprland/language" = {
                format-en = "us";
                format-fi = "fi";
                format-no = "no";
              };

              "hyprland/workspaces" = {
                all-outputs = true;
                persistent-workspaces."*" = 9;
              };

              "network" = {
                format-ethernet = "{ipaddr}/{cidr}";
                format-wifi = "{ipaddr} ({essid})";
                tooltip = false;
              };

              "niri/language" = {
                format-en = "us";
                format-fi = "fi";
                format-no = "no";
              };

              "wireplumber" = {
                format = "vol {volume}%";
                on-click = "pavucontrol";
                tooltip = false;
              };
            }
            cfg.extraConfig
          ])
        ];
        style = ''
          * {
            border: none;
            border-radius: 0;
            min-height: 0;
            margin: 0;
            padding: 0;
          }

          #waybar {
            background: #7298bf;
            color: #e0c296;
            font-family: VictorMono Nerd Font Mono;
            font-weight: 700;
            font-size: 12px;
          }

          #workspaces button {
            background: #7298bf;
            color: #888888;
          }

          #workspaces button.empty {
            background: #3f546a;
          }

          /* Hyprland */
          #workspaces button.visible {
            background: #7298bf;
            color: #e0c296;
          }

          /* Niri */
          #workspaces button.focused {
            background: #7298bf;
            color: #e0c296;
          }

          #custom-sep {
            margin: 0 0.25em;
          }
        '';
      };
    };
  };
}