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:
- Backs up the original file to
<name>.conf.orig - Writes a modified copy with your custom name
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fec6211a3edb13c75f8992bdf000d569eaff3f59c3e3875e1951d2c1fe42e108
|
|
| MD5 |
5259c82c50d8dbad69a99d2ff16a3c3c
|
|
| BLAKE2b-256 |
3737bf1f3704dea9bd625b79f0b3b59cb7eb7bd1b47b252221771143b1921564
|
Provenance
The following attestation bundles were made for portname-1.0.0.tar.gz:
Publisher:
publish.yml on slowe6629/portname
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
portname-1.0.0.tar.gz -
Subject digest:
fec6211a3edb13c75f8992bdf000d569eaff3f59c3e3875e1951d2c1fe42e108 - Sigstore transparency entry: 1280260261
- Sigstore integration time:
-
Permalink:
slowe6629/portname@59df3671cab1ef35cc348d62718fa1ed57a715fe -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/slowe6629
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@59df3671cab1ef35cc348d62718fa1ed57a715fe -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
194338f63f53947ca98a310d9f33b32a75b0ef110d8f96b117b57f436d630288
|
|
| MD5 |
dbf80e8b7507359ac6f11ee5d3960efb
|
|
| BLAKE2b-256 |
7896d94f133d57addb84a977c5cb9f8b3990eb5f38227936e835591db4f319eb
|
Provenance
The following attestation bundles were made for portname-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on slowe6629/portname
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
portname-1.0.0-py3-none-any.whl -
Subject digest:
194338f63f53947ca98a310d9f33b32a75b0ef110d8f96b117b57f436d630288 - Sigstore transparency entry: 1280260266
- Sigstore integration time:
-
Permalink:
slowe6629/portname@59df3671cab1ef35cc348d62718fa1ed57a715fe -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/slowe6629
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@59df3671cab1ef35cc348d62718fa1ed57a715fe -
Trigger Event:
release
-
Statement type: