summaryrefslogtreecommitdiff
path: root/home/apps/waybar/default.nix
blob: 25acb8f9cfc8c5f848a5872d8467c41890ea1423 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
  config,
  lib,
  ...
}: let
  inherit (lib) mkIf;
  cfg = config.apps.waybar;
in {
  config = mkIf cfg.enable {
    programs.waybar = {
      enable = true;

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

          modules-left = [
            "hyprland/workspaces"
          ];
          modules-center = [
            "clock"
          ];
          modules-right = [
            "battery"
            "wireplumber"
            "network"
            "tray"
          ];

          "hyprland/workspaces" = {
            disable-scroll = true;
            all-outputs = true;
            format = "{name}";
          };

          battery = {
            interval = 1;
            states = {
              warning = 30;
              critical = 15;
            };
            format = " {capacity}%";
            format-charging = " {capacity}%";
            format-plugged = " {capacity}%";
            format-full = " {capacity}%";
            format-warning = " {capacity}%";
            format-critical = " {capacity}%";
          };

          wireplumber = {
            format = " {volume}%";
            format-bluetooth = " {volume}%";
            format-muted = " muted";
            scroll-step = 1;
            on-click = "pavucontrol";
            ignored-sinks = ["Easy Effects Sink"];
          };

          network = {
            format = "  disconnected";
            format-wifi = " {essid}";
            format-ethernet = "  {ipaddr}/{cidr}";
            format-disconnected = "  disconnected";
            max-length = 50;
            on-click = "nm-connection-editor";
          };

          clock = {
            interval = 1;
            format = "{:%Y-%m-%d %a %H:%M:%S}";
          };

          tray = {
            spacing = config.theme.outerGap;
          };
        }
      ];

      style = import ./style.nix {theme = config.theme;};
    };
  };
}