summaryrefslogtreecommitdiff
path: root/home/apps/waybar/style.nix
blob: 21a8de5dcde4391b5e51ab24de638ab6748cc1a3 (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
{theme}: let
  text = "#${theme.colors.text}";
  base = "#${theme.colors.base}";
  surface = "#${theme.colors.surface}";
  primary = "#${theme.colors.primary}";
  success = "#${theme.colors.success}";
  warning = "#${theme.colors.warning}";
  error = "#${theme.colors.error}";
  fontSize = "${toString theme.font.size}px";
  outerGap = "${toString theme.outerGap}px";
  innerGap = "${toString theme.innerGap}px";
  outerRadius = "${toString theme.outerRadius}px";
  innerRadius = "${toString theme.innerRadius}px";
  borderWidth = "${toString theme.borderWidth}px";
in ''
  /** Base */

  * {
      all: unset;
  }

  window#waybar {
      font-family: "${theme.font.regular}", "${theme.font.icon}", "${theme.font.monospace}";
      font-size: ${fontSize};
      color: ${text};
      background-color: ${base};
  }

  /** Workspaces */

  #workspaces {
      margin-left: ${outerGap};
  }

  #workspaces button {
      border-radius: ${innerRadius};
      margin: 4px 2px;
      padding: 0px 7px;
      background: ${surface};
      color: ${text};
  }

  #workspaces button.focused,
  #workspaces button.active {
      background: ${primary};
      color: ${base};
  }

  #workspaces button.urgent {
      background: ${error};
  }

  /** Tray */

  #tray {
      border: none;
      margin-right: ${outerGap};
  }

  #tray > .passive {
      -gtk-icon-effect: dim;
  }

  #tray > .needs-attention {
      -gtk-icon-effect: highlight;
  }

  /** Right modules */

  #battery,
  #wireplumber,
  #network {
      padding: 0 ${outerGap};
  }

  /** Battery */

  #battery.charging {
      color: ${success};
  }

  #battery.warning:not(.charging) {
      color: ${warning};
  }

  #battery.critical:not(.charging) {
      color: ${error};
  }

  /** Wireplumber */

  #wireplumber.muted {
      color: ${error};
  }

  /** Network */

  #network.wifi,
  #network.ethernet {
      color: ${success};
  }

  #network.disconnected {
      color: ${error};
  }

''