about summary refs log tree commit diff stats
path: root/hm/waybar/default.nix
blob: 335bdc9b1b43bbb3990e04dc1b17b516fe6e95f2 (plain) (blame)
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
143
144
145
146
147
148
149
150
151
152
153
154
{pkgs, ...}: {
  programs.waybar = {
    enable = true;
    settings = {
      mainBar = {
        layer = "top";
        position = "top";
        modules-left = [
          "hyprland/workspaces"
          "clock"
        ];
        modules-center = ["hyprland/window"];
        modules-right = [
          "pulseaudio"
          "network"
          "backlight"
          "battery"
          "custom/notification"
          "tray"
        ];

        "hyprland/workspaces" = {
          disable-scroll = false;
          sort-by-name = true;
          format = "{name}";
          #format-icons = {default = "";};
          on-sroll-up = "hyprctl dispatch workspace e+1";
          on-scroll-down = "hyprctl dispatch workspace e-1";
          on-click = "activate";
        };

        "hyprland/window" = {
          max-length = 200;
          separate-outputs = true;
        };

        pulseaudio = {
          format = " {icon} ";
          format-muted = "ﱝ";
          format-icons = [
            "奄"
            "奔"
            "墳"
          ];
          tooltip = true;
          tooltip-format = "{volume}%";
        };

        network = {
          format-wifi = " ";
          format-disconnected = "睊";
          format-ethernet = " ";
          tooltip = true;
          tooltip-format = "{signalStrength}%";
        };

        backlight = {
          device = "intel_backlight";
          format = "{icon}";
          format-icons = [
            ""
            ""
            ""
            ""
            ""
            ""
            ""
            ""
            ""
          ];
          tooltip = true;
          tooltip-format = "{percent}%";
        };

        battery = {
          states = {
            warning = 30;
            critical = 15;
          };
          events = {
            on-discharging-warning = "${pkgs.libnotify}/bin/notify-send -u normal 'Low Battery'";
            on-discharging-critical = "${pkgs.libnotify}/bin/notify-send -u critical 'Very Low Battery' 'Hibernating soon'";
            on-discharging-11 = "${pkgs.libnotify}/bin/notify-send -u critical 'Very Low Battery' 'Hibernating now'";
            on-discharging-10 = "${pkgs.systemd}/bin/systemctl hibernate --check-inhibitors=no";
          };
          format = "{capacity}% {icon}";
          format-charging = "";
          format-plugged = "";
          format-icons = [
            ""
            ""
            ""
            ""
            ""
            ""
            ""
            ""
            ""
            ""
            ""
            ""
          ];
          tooltip = true;
          tooltip-format = "{capacity}%";
        };

        # "custom/power" = {
        #   tooltip = false;
        #   on-click = "powermenu";
        #   format = "襤";
        # };

        clock = {
          tooltip-format = ''
            <big>{:%Y %B}</big>
            <tt><small>{calendar}</small></tt>'';
          format-alt = ''{:%d %m %Y}'';
          format = ''{:%H %M}'';
        };

        tray = {
          icon-size = 10;
          spacing = 5;
        };
        "custom/notification" = {
          tooltip = false;
          format = "{icon}";
          format-icons = {
            notification = " ";
            none = " ";
            dnd-notification = " ";
            dnd-none = " ";
            inhibited-notification = " ";
            inhibited-none = " ";
            dnd-inhibited-notification = " ";
            dnd-inhibited-none = " ";
          };
          return-type = "json";
          exec-if = "which swaync-client";
          exec = "swaync-client -swb";
          on-click = "swaync-client -t -sw";
          on-click-right = "swaync-client -d -sw";
          escape = true;
        };
      };
    };

    #style = ./style.css;
    systemd = {
      enable = true;
      target = "hyprland-session.target";
    };
  };
}