Skip to main content

Rename PipeWire/ALSA audio ports as they appear in Sound Settings

Project description

Portname — Rename Audio Ports on Linux

Ever wished you could change "Line Out" to "JBL Headset" or "Headphones" to "Pebble Speakers" in your Sound Settings? Now you can.

Portname lets you rename the audio input/output ports that appear in your system's Sound Settings panel. Works with PipeWire and ALSA on any Linux distribution.

Before & After

Before:                              After:
  Line Out                             JBL Headset
  Starship/Matisse HD Audio            Starship/Matisse HD Audio

  Headphones                           Pebble Speakers
  Starship/Matisse HD Audio            Starship/Matisse HD Audio

Install

pip install portname

To update to the latest version:

pip install --upgrade portname

Alternative — install from source:

git clone https://github.com/offbyonebit/portname.git
cd portname
chmod +x install.sh
./install.sh

Usage

GUI (recommended for beginners)

Just run portname or find Portname in your application menu. Click Rename next to any audio port, type a new name, and enter your password when prompted.

Command Line

# List all audio devices and ports
portname list

# Rename a port (requires sudo)
sudo portname rename analog-output-lineout "JBL Headset"
sudo portname rename analog-output-headphones "Pebble Speakers"
sudo portname rename analog-input-rear-mic "JBL Headset Mic"

# Revert a single port
sudo portname revert analog-output-lineout

# Revert all renamed ports
sudo portname revert --all

# Check for renames clobbered by a package upgrade and re-apply them (Arch/Fedora)
sudo portname check

# Toggle Auto-Mute Mode (fixes issue where front jack silences rear jacks)
portname auto-mute off
portname auto-mute on
portname auto-mute status

How It Works

Audio port names on Linux come from ALSA card profile path files in /usr/share/alsa-card-profile/mixer/paths/. Portname:

  1. Backs up the original file to <name>.conf.orig
  2. Writes a modified copy with your custom name
  3. Restarts PipeWire so the change appears immediately

Your custom names survive reboots. On Debian/Ubuntu the backup is registered with dpkg-divert, which also tells the package manager to skip the file on upgrades. On other distros (Arch, Fedora, etc.) the backup/restore logic is identical but there is no package-manager hook — an upgrade of alsa-card-profile can silently overwrite the modified file. Run sudo portname check after such an upgrade to detect and automatically re-apply any clobbered names. AUR/Copr package descriptions should note this and suggest adding a post-upgrade hook that calls portname check.

Compatibility

Distro Status
Linux Mint 22 ✅ Fully tested
Ubuntu 22.10+ ✅ Fully tested
Arch Linux ⚠️ Core features tested via CI — real-machine audio feedback not yet verified
Fedora ⚠️ Core features tested via CI — real-machine audio feedback not yet verified
Other PipeWire distros ⚠️ Should work, but untested

Arch / Fedora users: portname works on your distro, but hasn't been tested by a real person on real hardware yet. If something doesn't behave as expected — names not showing up in Sound Settings, the audio system not restarting, anything — please open an issue and describe what happened. That feedback is how we close the gap.

Does not work on distros still using PulseAudio without PipeWire.

Requirements

  • Linux with PipeWire (standard on most distros from 2022 onward)
  • Python 3.8+
  • GTK3 via PyGObject (pre-installed on most desktop Linux distros)

Uninstall

cd portname
./install.sh --uninstall

This reverts all renamed ports to their original names and removes portname.

License

MIT

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

portname-1.0.1.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

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

portname-1.0.1-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file portname-1.0.1.tar.gz.

File metadata

  • Download URL: portname-1.0.1.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for portname-1.0.1.tar.gz
Algorithm Hash digest
SHA256 26cf8599ac793367bd1c18c9e4a5e5a9d3009841920054dfd0b8765156c34571
MD5 03d9af33d75a398b0210a5fde4478d7f
BLAKE2b-256 9a07b4ce34fc29444f90bda75dfa3393bf8db03f780ca7f37b1192348adaa58c

See more details on using hashes here.

Provenance

The following attestation bundles were made for portname-1.0.1.tar.gz:

Publisher: publish.yml on offbyonebit/portname

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file portname-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: portname-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for portname-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72025edae8b1132b65e7244c8d4587275a1895e8f80f7e32068dafe6b8807cb1
MD5 2b21b77cbe6a705f88261016f821cc3d
BLAKE2b-256 aafe9826f752d7d1f7fb3d9c4a6863986582c6ef3b1970b1c46718aca22c973f

See more details on using hashes here.

Provenance

The following attestation bundles were made for portname-1.0.1-py3-none-any.whl:

Publisher: publish.yml on offbyonebit/portname

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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