# PulseAudio (https://mangowm.github.io/docs/bar/modules/pulseaudio)

Shows the PulseAudio volume (the "volume" module, with ALSA fallback), mute
state and Bluetooth marker. Updates immediately on external changes via
PulseAudio events.

```jsonc
"modules-right": ["pulseaudio"],

"pulseaudio": {
    "format": "{icon} {volume}% {bt}",
    "format-muted": " {volume}% {bt}",
    "icons": ["", "", "", "", "", "", "", ""],
    "icon-bluetooth": "󰂯",
    "scroll-step": 5,
    "max-volume": 150
}
```

## Options [#options]

| Option                            | Type         | Default | Description                                                |
| --------------------------------- | ------------ | ------- | ---------------------------------------------------------- |
| `format`                          | string       | —       | Normal format (see placeholders)                           |
| `format-muted`                    | string       | —       | Format used while muted                                    |
| `icons`                           | string array | —       | Icons shown by volume level                                |
| `icon-muted`                      | string       | —       | Icon used when muted                                       |
| `icon-bluetooth`                  | string       | —       | Bluetooth marker shown when the active sink is a BT device |
| `scroll-step`                     | number       | `5`     | Percentage points to change per wheel tick                 |
| `max-volume`                      | number       | `100`   | Maximum volume percent reachable by scrolling              |
| `on-scroll-up` / `on-scroll-down` | string       | —       | Custom commands that replace the built-in wheel handling   |

The module controls the default sink directly through mangobar's PulseAudio
connection. Volumes above 100% are displayed as their actual value. Configuring
either scroll command replaces both built-in scroll directions; commands may
use the other common action options such as `on-click`.

## Placeholders [#placeholders]

| Placeholder                     | Description                                   |
| ------------------------------- | --------------------------------------------- |
| `{}` / `{volume}` / `{percent}` | Volume percent                                |
| `{icon}`                        | Icon selected from the `icons` array by level |
| `{bt}` / `{bluetooth}`          | Bluetooth marker (empty when not a BT sink)   |

## Styling [#styling]

```css
#volume {
  background: linear-gradient(to top, #e3ac2b, mix(#e3ac2b, #fbf1c7, 0.3));
  color: #1b1a1a;
}
```