about summary refs log tree commit diff
path: root/users/fcuny/desktop/sway/waybar.nix
blob: eeabe1496213a3fe244f1fdecc46a866c1baa1aa (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
{ config, pkgs, lib, ... }:

{
  programs.waybar = {
    enable = true;
    systemd.enable = true;
    settings = [{
      layer = "top";
      position = "top";
      height = 20;
      modules-left = ["sway/workspaces" "sway/mode"];
      modules-center = ["sway/window"];
      modules-right = [ "mpd" "network" "pulseaudio" "battery" "clock" ];
      modules = {
        "network" = {
          format-wifi = "{essid}:{signalStrength}%";
          format-ethernet = "{ifname}: {ipaddr}";
          format-disconnected = "Disconnected";
        };
        "pulseaudio" = {
          format = "{volume}%";
          "on-click" = "${pkgs.pavucontrol}/bin/pavucontrol";
        };
        "clock" = {
          format = "{:%a %d %b %H:%M}";
        };
      };
    }];

    style = ''
    * {
      border: none;
      border-radius: 0;
      min-height: 0;
      margin: 0;
      padding: 0;
    }

    #waybar {
      background: #000000;
      color: white;
      font-family: Source Code Pro;
      font-size: 12px;
    }

    #clock,
    #mode,
    #network,
    #pulseaudio {
      padding-left: 10px;
      padding-right: 10px;
    }

    #clock {
      font-weight: bold;
    }

    #mode {
      background: #64727D;
      border-top: 2px solid white;
      padding-bottom: 2px;
    }

    #network {
    }

    #network.disconnected {
      color: orange;
    }

    #pulseaudio {
    }

    #pulseaudio.muted {
    }

    #window {
      font-weight: bold;
    }

    #workspaces button {
      border-top: 2px solid transparent;
      /* To compensate for the top border and still have vertical centering */
      padding-bottom: 2px;
      padding-left: 10px;
      padding-right: 10px;
      color: #888888;
    }

    #workspaces button.focused {
      border-color: #4c7899;
      color: white;
      background-color: #285577;
    }

    #workspaces button.urgent {
      border-color: #c9545d;
      color: #c9545d;
    }
    '';
  };
}