aboutsummaryrefslogtreecommitdiff
path: root/modules/home-manager/waybar.nix
blob: 8be6ec9c5e30f762c56d8d72333e29ceb15883f0 (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
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
138
139
140
141
142
{
  config,
  lib,
  ...
}:

{
  options.waybar.enable = lib.mkEnableOption "Enable and configure Waybar";
  config = lib.mkIf config.waybar.enable {
    programs.waybar = {
      enable = true;
      settings = {
        mainBar = {
          height = 32;
          layer = "top";
          position = "bottom";
          modules-center = [ ];
          modules-left = [ "sway/workspaces" ];
          modules-right = [
            "group/expand"
            "battery"
            "pulseaudio"
            "network"
            "bluetooth"
            "clock"
          ];

          "group/expand" = {
            orientation = "horizontal";
            drawer = {
              transition-duration = 600;
              transition-to-left = true;
              click-to-reveal = true;
            };
            modules = [
              "custom/expand"
              "tray"
              "privacy"
              "cpu"
              "memory"
              "temperature"
            ];
          };

          "custom/expand" = {
            format = "";
            tooltip = false;
          };

          tray = {
            spacing = 10;
          };

          privacy = {
            icon-size = 16;
          };

          cpu = {
            format = "󰻠";
            tooltip = true;
          };

          memory = {
            format = "";
          };

          temperature = {
            critical-threshold = 80;
            format = "";
          };

          network = {
            format-disconnect = "󰌙";
            format-ethernet = "󰌘";
            format-wifi = "{icon}";
            format-icons = [
              "󰤟"
              "󰤢"
              "󰤥"
              "󰤨"
            ];

            tooltip-format-wifi = "{essid} | {signalStrength}%";
            tooltip-format-ethernet = "{ifname}";
          };

          bluetooth = {
            format = " {status}";
            format-disabled = "";
            format-no-controller = "";
            format-connected = " {device_alias}";
            tooltip = false;
          };

          clock = {
            format-alt = "{:%Y-%m-%d}";
            tooltip-format = "{:%Y-%m-%d | %H:%M}";
          };

          pulseaudio = {
            format = "{icon}";
            format-icons = {
              default = [
                ""
                ""
                ""
              ];
            };
						tooltip-format = "{desc} | {volume}%";
          };
        };
      };

      style = ''
        * {
          border: none;
          border-radius: 0;
          font-family: monospace;
          font-size: 12px;
        }

        window#waybar {
          background: rgba(0, 0, 0, 0.9);
        }

        #workspaces button {
          padding-left: 5px;
          padding-right: 5px;
        }

        #workspaces button.focused {
          font-weight: bold;
        }

        #clock, #pulseaudio, #tray, #network, #battery, #bluetooth, #cpu, #memory, #temperature, #custom-expand, #group-expand {
          padding-left: 10px;
          padding-right: 10px;
        }
      '';
    };
  };
}