{ ... }:

{
  programs.waybar = {
    enable = true;

    settings = [
      {
        layer = "top";
        position = "top";
        height = 24;

        modules-left = [
          "sway/workspaces"
          "sway/mode"
          "sway/window"
        ];

        modules-right = [
          # "cpu"
          # "memory"
          # "disk"
          "network"
          "pulseaudio"
          "backlight"
          "battery"
          "tray"
          "clock"
        ];

        cpu = {
          interval = 11;
          format = "ï¬™ {usage}% {load}";
        };

        memory = {
          interval = 13;
          format = "ï¡š {used:0.1f}/{total:0.1f}GiB";
        };

        disk = {
          interval = 127;
          format = "ïŸ‰ {used}/{total}";
        };

        network = {
          format-ethernet = "ï›¿ {signalStrength} {essid}";
          format-wifi = "ï¬‰ {signalStrength} {essid}";
          format-disconnected = "ï ˜ {ifname} disconnected";
        };

        pulseaudio = {
          scroll-step = 2;
          format = "{icon} {volume}%";
          format-bluetooth = "{icon} {volume}% ï–¯";
          format-muted = "ğŸ”‡ {volume}%";

          format-icons = {
            default = [ "ï€§" "ï€¨" ];
            headphone = [ "ï€¥" "ïŸŠ" ];
            headset = "ïŸ�";
            phone = "ïŠ ";
            speaker = [ "ğŸ”ˆ" "ğŸ”‰" "ğŸ”Š" ];
          };
        };

        backlight = {
          format = "{icon} {percent}%";
          format-icons = [ "â—‹" "â—�" "â—�" ];
        };

        battery = {
          interval = 23;
          format = "{icon} {capacity}% {time}";
          format-charging = "ï–ƒ {capacity}% {time}";
          format-time = "ï‰’ {H}:{M}";
          format-icons = [ "ï–�" "ï•¹" "ï•º" "ï•»" "ï•¼" "ï•½" "ï•¾" "ï•¿" "ï–€" "ï–�" "ï•¸" ];
        };

        clock = {
          format = "ï—µ {:%Y-%m-%dT%H:%M}";
          today-format = "{%Y-%m-%d}";
        };
      }
    ];

    style = builtins.readFile ./style.css;
    systemd.enable = true;
  };

  systemd.user.targets.tray = {
    Unit = {
      Description = "Home Manager System Tray";
      Requires = [ "graphical-session-pre.target" ];
    };
  };

  wayland.windowManager.sway.config.bars = [ ];
  # [{
  #   command = "${pkgs.waybar}/bin/waybar";
  #   fonts = {
  #     names = [ config.fonts.sansSerif ];
  #     style = "Regular";
  #     size = 10.0;
  #   };
  # }];
}
