Skip to main content

A simple script to control PulseAudio devices

Project description

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.

This package can be installed using pipx:

pipx install pulseaudio_device_control

Usage

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.

[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:

import pulsectl

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulseaudio_device_control-0.4.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pulseaudio_device_control-0.4-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file pulseaudio_device_control-0.4.tar.gz.

File metadata

  • Download URL: pulseaudio_device_control-0.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pulseaudio_device_control-0.4.tar.gz
Algorithm Hash digest
SHA256 839a728f9367aa850264263bcec5b16ffd3fe5196e5a67c5218a4926bfc39885
MD5 45cfa489b12460947d2ca478b5bd1afd
BLAKE2b-256 5701148b26eb09ca1b2e85185dcc02907cb485be4ad3241ebe3c3616a6fd0c46

See more details on using hashes here.

File details

Details for the file pulseaudio_device_control-0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pulseaudio_device_control-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 65241ad9b432460a554bcba348943c51502f9909dc1e165e79211ee9c3a4661f
MD5 0e967d3a038daa638f474393a9829977
BLAKE2b-256 16afa73f9dca6db55853c058fc51effebec9b395fa42e542ac14e6c3943cca61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page