DEVELOPMENT ENVIRONMENT

~liljamo/nix-arta

nix-arta/modules/home/waybar.nix -rw-r--r-- 3.1 KiB
071cd421Jonni Liljamo feat: arwen kanshi 24 days ago
                                                                                
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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;
          }
        '';
      };
    };
  };
}