raffi 0.25.0

A simple fuzzel launcher based on YAML file
Documentation
---
title: Audio Switcher
description: Change the volume, pick the default speaker or microphone and mute devices from Raffi
---

import { Aside } from '@astrojs/starlight/components';
import { Image } from 'astro:assets';
import audioScreenshot from '../../../assets/screenshots/audio-switcher.png';
import volumeScreenshot from '../../../assets/screenshots/audio-volume.png';

<Image src={audioScreenshot} alt="Audio outputs with demo headphones selected and their volume and default-device details" width={800} />

<Image src={volumeScreenshot} alt="Typing audio 40 offers to set the default output volume to 40 percent" width={800} />

Type `audio ` (with the trailing space) to list your sound devices. A
"Volume" group comes first with "Volume up", "Volume down", "Mute output"
and "Mute microphone" for the default devices. The volume rows show the
change they make, such as `60% → 65%`. Outputs,
such as speakers and headphones, come next under an "Outputs" header, then
inputs such as microphones under "Inputs". Each row shows the device name,
its port, its volume and its internal name. The current default device has a
check mark and says "Default", and a muted device says "Muted". Monitor
sources, which only echo an output, are left out.

Words after the keyword filter the devices, so `audio headphones` or
`audio razer` narrows the list, and `audio inputs` shows the microphones.

Type a number to set the output volume directly: `audio 40`, `audio vol 40`
or `audio volume 40%` adds a "Set output volume to 40%" row at the top. The
volume never goes above `max_volume`. When the audio addon is in
[`main_view`](../../configuration/general-settings/#main-view), typing `vol 40`
in the main list does the same. A bare number there is left to the
calculator.

<Aside type="note">
The audio switcher is only available in native mode and needs `pactl`,
which works with PulseAudio and with PipeWire through `pipewire-pulse`. It is
on by default. When `pactl` is not installed the list shows "pactl not
found". When the sound server can't be reached, an error row says so.
</Aside>

| Key        | Action                                     |
|------------|--------------------------------------------|
| Enter      | Make the selected device the default       |
| Ctrl+Enter | Mute or unmute the selected device         |

Raffi stays open after an action and refreshes the list, keeping the same
device selected. When an action fails, an error row appears at the top of the
list. Set `close_on_action: true` to close Raffi after each action instead.

The header rows only show information and do nothing when selected. Queries
typed in this mode are not saved in the search history.

To open the list from a key binding, pass the keyword as the initial query:

```sh
raffi -u native -i "audio "
```

## Configuration

```yaml
addons:
  audio:
    trigger: "snd"
    close_on_action: true
    volume_step: 10   # Volume up and down change it by 10% (default: 5)
    max_volume: 150   # Allow boosting past 100% (default: 100)
```

See the [addon reference](../../reference/addon-configuration/#audio-switcher)
for every field.