aboutsummaryrefslogtreecommitdiff
path: root/dot-config/yambar/config.yml
blob: 40c0c178e39c1c31feee6d4991d92a0dd24946ee (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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
#
# YAMBAR
#

# VARIABLES
define:
  # Colours
  - &bg 000000ff
  - &bgdim 00000088

  - &mg 222222ff

  - &fg ffffffff
  - &fgdim ffffff88

  - &hidden 00000000

  - &red ff959cff
  - &green 90ee90ff
  - &blue 89b4faff
  - &purple cba6f7ff
  - &yellow f1c40fff
  - &teal 00ddccff
  - &orange fab12Fff

  - &RED ff0000ff
  - &GRN 00ff00ff
  - &YLW ffff00ff

  # Settings
  - &font 'HackNerdFont:size=24:weight=regular'
  - &margin 20
  - &height 50

  # Actions
  - &select-workspace "swaymsg workspace number {name}"
  - &calendar footclient calcurse
  - &audiomixer footclient pulsemixer
  - &network-control iwd-control.sh
  - &volume-up volume up 1%
  - &volume-down volume down 1%
  - &brightness-up brightnessctl set +1%
  - &brightness-down brightnessctl --min-value=10 set 1-%

  # Scripts
  - &pacman-notify ~/.config/yambar/scripts/pacman-notify
  - &pacman-update ~/.config/yambar/scripts/pacman-update
  - &newsboat-open ~/.config/yambar/scripts/newsboat-open
  - &notify-bat ~/.config/yambar/scripts/notify-bat

# MODULES
battery: &battery
  name: BAT0
  poll-interval: 5000
  content:
    map:
      on-click: *notify-bat
      foreground: *teal
      margin: *margin
      default: {string: {text: "{state}"}}
      conditions:
        state == "discharging":
        - ramp:
           tag: capacity
           items:
             - string: {text: "{capacity}% 󰁺", foreground: *RED}
             - string: {text: "{capacity}% 󰁻", foreground: *orange}
             - string: {text: "{capacity}% 󰁼", foreground: *yellow}
             - string: {text: "{capacity}% 󰁽", foreground: *yellow}
             - string: {text: "{capacity}% 󰁾"}
             - string: {text: "{capacity}% 󰁿"}
             - string: {text: "{capacity}% 󰂀"}
             - string: {text: "{capacity}% 󰂁"}
             - string: {text: "{capacity}% 󰂂"}
             - string: {text: "{capacity}% 󰁹"}
        state == "charging":
        - ramp:
           tag: capacity
           items:
             - string: {text: "({estimate}) {capacity}% 󰢜", foreground: *RED}
             - string: {text: "({estimate}) {capacity}% 󰂆", foreground: *orange}
             - string: {text: "({estimate}) {capacity}% 󰂇", foreground: *yellow}
             - string: {text: "({estimate}) {capacity}% 󰂈", foreground: *yellow}
             - string: {text: "({estimate}) {capacity}% 󰢝"}
             - string: {text: "({estimate}) {capacity}% 󰂉"}
             - string: {text: "({estimate}) {capacity}% 󰢞"}
             - string: {text: "({estimate}) {capacity}% 󰂊"}
             - string: {text: "({estimate}) {capacity}% 󰂋"}
             - string: {text: "({estimate}) {capacity}% 󰂅"}
        state == "full":
          - string: {text: "{capacity}% 󰁹", foreground: *green}

pipewire: &pipewire
  content:
    map:
      margin: *margin
      foreground: *yellow
      conditions:
        type == "sink":
          map:
            default:
             - ramp:
                tag: cubic_volume
                items:
                  - string: {text: "{cubic_volume}% "}
                  - string: {text: "{cubic_volume}% "}
                  - string: {text: "{cubic_volume}% "}
            conditions:
              muted: {string: {text: "mute ", foreground: *red}}
      on-click:
        left: *audiomixer
        wheel-up: *volume-up
        wheel-down: *volume-down

network: &network
  content:
    map:
      conditions:
        name == "wlan0":
          map:
            default: {string: {text: "{ssid} ({state}) "}}
            conditions:
              state == "up":
                string: {text: "{ssid} ", margin: *margin, foreground: *green}
              state == "down":
                string: {text: "offline ", margin: *margin, foreground: *red}
      on-click: *network-control

clock: &clock
  time-format: "%R"
  content:
    string: {text: "{time} ", margin: *margin, foreground: *blue}

date: &date
  date-format: "%a %b %d"
  content:
    string:
      text: "{date} "
      margin: *margin
      foreground: *purple
      on-click: *calendar

workspace: &workspace
  sort: ascending
  spacing: 5
  content:
    "":
      map:
        default:
          string: {text: "{name}", margin: *margin, foreground: *fgdim}
        conditions:
          name == "0": {string: {text: ""}}
          state == "focused":
            string: {text: "{name}", margin: *margin, foreground: *fg}
          state == "urgent":
            string: {text: "{name}", margin: *margin, foreground: *red}
        on-click: *select-workspace

# Note: name is found in '/sys/class/backlight'
backlight: &backlight
  name: intel_backlight
  content:
    string:
      text: "{percent}% "
      margin: *margin
      foreground: *fg
      on-click:
        wheel-up: *brightness-up
        wheel-down: *brightness-down

pacman: &pacman
  path: ~/.config/yambar/scripts/pacman
  poll-interval: 5000
  content:
    string:
      text: "{count} "
      foreground: *red
      margin: *margin
      on-click:
        left: *pacman-notify
        right: *pacman-update

# Newsboat
newsboat: &newsboat
  path: ~/.config/yambar/scripts/newsboat
  args: []
  poll-interval: 10000
  content:
    string:
      text: "{unread} "
      foreground: *orange
      margin: *margin
      on-click:
        left: *newsboat-open

mpd: &mpd
  host: /run/user/1000/mpd/socket
  anchors:
    mpd-anchor: &mpd-anchor
      foreground: *fg
      margin: *margin
  content:
    map:
      default: {string: {text: "{state} 🎶", <<: *mpd-anchor}}
      conditions:
        state == playing:
          string: {text: "{artist} - {title} 🎶", <<: *mpd-anchor}
        state == paused:
          string: {text: "{artist} - {title} 🎶", <<: *mpd-anchor, foreground: *fgdim}
        state == stopped:
          string: {text: "mpd 🎶", <<: *mpd-anchor}
      on-click:
        left: mpc toggle
        right: mpc next
        wheel-up: mpc next
        wheel-down: mpc prev

# LAYOUT
bar:
  location: top
  foreground: *fg
  background: *mg
  margin: *margin
  font: *font
  spacing: 10
  height: 45
  border: {color: *bg, bottom-width: 2}

  left:
   - i3: *workspace

  right:
   - mpd: *mpd
   - script: *newsboat
   - script: *pacman
   - network: *network
   - backlight: *backlight
   - battery: *battery
   - pipewire: *pipewire
   - clock: *date
   - clock: *clock