Metadata-Version: 2.4
Name: pulseaudio_device_control
Version: 0.4
Summary: A simple script to control PulseAudio devices
Author-email: Brenton Leighton <12228142+brenton-leighton@users.noreply.github.com>
Maintainer-email: Brenton Leighton <12228142+brenton-leighton@users.noreply.github.com>
License: MIT License
        
        Copyright (c) 2024 Brenton Leighton
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/brenton-leighton/pulseaudio_device_control
Keywords: pulseaudio
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pulsectl
Dynamic: license-file

# pulseaudio_device_control

A simple script to control PulseAudio devices.
Mainly this is to easily cycle the default sink or source.

## Installation

pulseaudio\_device\_control depends on [pulsectl](https://github.com/mk-fg/python-pulse-control).

This package can be installed using [pipx](https://pipx.pypa.io/stable/installation/):

```bash
pipx install pulseaudio_device_control
```

## Usage

```bash
pulseaudio_device_control OPERATION DEVICE_TYPE [AMOUNT]
```

Where:

- `OPERATION` is `raise`, `lower`, `mute`, or `next`
- `DEVICE_TYPE` is `sink` or `source`
- `AMOUNT` is a percentage value for the raise and lower operations (optional, defaults to 2)

When using `next` any device name ending with `monitor` is skipped.

## Configuration

pulseaudio_device_control can be configured with a file located at `~/.config/pulseaudio_device_control/config.ini`,
e.g.

```ini
[next]
# Ignore devices from the next command (devices ending in "monitor" are always ignored)
sink_ignore = ["sink_name1", "sink_name2"]
source_ignore = ["source_name1", "source_name2"]
```

The names of PulseAudio sink/source devices can be printed with:

```python
import pulsectl

pulse = pulsectl.Pulse()
print([sink.name for sink in pulse.sink_list()])
print([source.name for source in pulse.source_list()])
```
