cheat.sheets:pactl
# pactl
# Control a running PulseAudio sound server.
# List all loaded modules
pactl list modules
# Load a module
pactl load-module module-name
# Unload a module by its index
pactl unload-module module-index
# List all available sinks (output devices)
pactl list sinks
# List all available sources (input devices)
pactl list sources
# Set the default sink (output device) by its name
pactl set-default-sink sink-name
# Set the default source (input device) by its name
pactl set-default-source source-name
# Set the volume of a sink (output device) by its name or index to 50%
pactl set-sink-volume sink-name-or-index 50%
# Mute a sink (output device) by its index
pactl set-sink-mute sink-index 1
# Unmute a sink (output device) by its index
pactl set-sink-mute sink-index 0
# Move a sink input (audio stream) to a different sink by their index
pactl move-sink-input sink-input-index sink-index
# Kill a client by its index
pactl kill-client client-index
# Kill a sink input by its index
pactl kill-sink-input sink-input-index
# Display a sorted and uniq-ified list of PulseAudio modules, using AWK.
pactl list modules short | awk '{!Lines[$2]++} END {asorti(Lines, Sorted); for (Line in Sorted) print(Sorted[Line])}'
cheat:pactl
---
syntax: bash
tags: [ audio, pulseaudio ]
---
# INCREASE the volume of default sink by 2.5%
pactl set-sink-volume @DEFAULT_SINK@ +2.5%
# DECREASE the volume of default sink by 2.5%
pactl set-sink-volume @DEFAULT_SINK@ -2.5%
# Toggle mute the default sink
pactl set-sink-mute @DEFAULT_SINK@ toggle
tldr:pactl
# pactl
# Control a running PulseAudio sound server.
# More information: <https://manned.org/pactl>.
# List all sinks (or other types - sinks are outputs and sink-inputs are active audio streams):
pactl list sinks short
# Change the default sink (output) to 1 (the number can be retrieved via the `list` subcommand):
pactl set-default-sink 1
# Move sink-input 627 to sink 1:
pactl move-sink-input 627 1
# Set the volume of sink 1 to 75%:
pactl set-sink-volume 1 0.75
# Toggle mute on the default sink (using the special name `@DEFAULT_SINK@`):
pactl set-sink-mute @DEFAULT_SINK@ toggle
$
cheat.sh