aboutsummaryrefslogtreecommitdiff
path: root/modules/user/desktop/apps/waybar/default.nix
blob: 127954ac6e3bb9501b255e9edae6a0f7ca9beb45 (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
{ config, ... }:
{
  programs.waybar = {
    settings.main = {
      layer = "bottom";
      position = "bottom";
      modules-left = [ "sway/workspaces" ];
      modules-center = [ "clock" ];
      modules-right = [
        "wireplumber"
        "battery"
        "backlight"
        "sway/language"
        "tray"
      ];

      backlight = {
        format = "{icon}";
        format-icons = [ "" "󰖨" ];
      };

      battery = {
        format = "{icon}";
        format-critical = "{icon} {capacity}%";
        format-icons = {
          good = [ "" ];
          okay = [ "" ];
          mediocre = [ "" ];
          low = [ "" ];
          critical = [ "" ];
        };

        format-low = "{icon} {capacity}%";
        format-time = "{H}h{m}m";
        states = {
          good = 85;
          okay = 75;
          mediocre = 50;
          low = 25;
          critical = 10;
        };

        tooltip-format = "{timeTo} ({power}W)";
        tooltip-format-critical = "please. charge me.";
      };

      clock = {
        format = "{:%A, %b %d %Y | %H:%M}";
      };

      "sway/language" = {
        on-click = "swaymsg input type:keyboard xkb_switch_layout next";
        tooltip-format = "{long}";
      };

      "sway/workspaces" = {
        all-outputs = true;
        disable-auto-back-and-forth = true;
        format = "{icon}";
        format-icons = {
          "1" = "I";
          "2" = "II";
          "3" = "III";
          "4" = "IV";
          "5" = "V";
          "6" = "VI";
          "7" = "VII";
          "8" = "VIII";
          "9" = "IX";
        };
      };

      wireplumber = {
        format = "{icon}";
        format-icons = [ "󰕿" "󰖀" "󰕾" ];
        format-muted = "󰝟";
        tooltip-format = "{node_name} ({volume}%)";
      };
    };

    style = builtins.readFile ./style.css;
  };
}