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

git clone https://github.com/slowe6629/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.0.tar.gz (21.8 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.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: portname-1.0.0.tar.gz
  • Upload date:
  • Size: 21.8 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.0.tar.gz
Algorithm Hash digest
SHA256 fec6211a3edb13c75f8992bdf000d569eaff3f59c3e3875e1951d2c1fe42e108
MD5 5259c82c50d8dbad69a99d2ff16a3c3c
BLAKE2b-256 3737bf1f3704dea9bd625b79f0b3b59cb7eb7bd1b47b252221771143b1921564

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on slowe6629/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.0-py3-none-any.whl.

File metadata

  • Download URL: portname-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 194338f63f53947ca98a310d9f33b32a75b0ef110d8f96b117b57f436d630288
MD5 dbf80e8b7507359ac6f11ee5d3960efb
BLAKE2b-256 7896d94f133d57addb84a977c5cb9f8b3990eb5f38227936e835591db4f319eb

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on slowe6629/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