Skip to content

Instantly share code, notes, and snippets.

@bgeVam
Last active October 29, 2018 04:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgeVam/2d7ff13003fb63debf9fb57bffc9effd to your computer and use it in GitHub Desktop.
Save bgeVam/2d7ff13003fb63debf9fb57bffc9effd to your computer and use it in GitHub Desktop.
Temporary "fix" for missing audio outputs in elementaryOS 5.0
As Juno for now does not support switching the audio profile via sound settings and I constantly switch
between my desk speaker and notebook speaker only I created this gist.
The idea is a simple .desktop file with two actions that are enabled via right click.
Here is how to:
0. Check your current profile
pacmd list-cards | grep "active profile:"
Note it down, in case you need to reset!!
1. List your audio profiles
pacmd list-cards | grep "output:"
Sample Output:
output:analog-stereo: Analog Stereo Output (priority 6000, available: unknown)
output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5200, available: unknown)
2. Check in command line which one outputs the sound correctly
pactl set-card-profile 0 output:analog-stereo
3. Create a new desktop file
sudo nano /usr/share/applications/change_audio_profile.desktop
4. Paste in the following
[Desktop Entry]
Version=1.0
Name=Change Audio Profile
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Change Audio Profile
# Gnome and KDE 3 uses Comment.
Comment=Change Audio Profile
Exec=/usr/bin/pactl set-card-profile 0 output:analog-stereo
StartupNotify=true
Terminal=false
Icon=multimedia-volume-control
Type=Application
Categories=Audio;AudioVideo;Mixer;
MimeType=text/html;
Actions=set-default-stereo;set-hdmi-stereo-extra;
[Desktop Action set-default-stereo]
Name=Audio To Default Stereo
Exec=/usr/bin/pactl set-card-profile 0 output:analog-stereo
[Desktop Action set-hdmi-stereo-extra]
Name=Audio To HDMI Stereo
Exec=/usr/bin/pactl set-card-profile 0 output:hdmi-stereo-extra1
5. Replace the outputs in the example above with your desired outputs
NOTE: If you add a new "Desktop Action" don't forget to add it in "Actions" above.
NOTE: Don't forget to validate your desktop file afterwards. (desktop-file-validate /usr/share/applications/change_audio_profile.desktop)
[Desktop Entry]
Version=1.0
Name=Change Audio Profile
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Change Audio Profile
# Gnome and KDE 3 uses Comment.
Comment=Change Audio Profile
Exec=/usr/bin/pactl set-card-profile 0 output:analog-stereo
StartupNotify=true
Terminal=false
Icon=multimedia-volume-control
Type=Application
Categories=Audio;AudioVideo;Mixer;
MimeType=text/html;
Actions=set-default-stereo;set-hdmi-stereo-extra;
[Desktop Action set-default-stereo]
Name=Audio To Default Stereo
Exec=/usr/bin/pactl set-card-profile 0 output:analog-stereo
[Desktop Action set-hdmi-stereo-extra]
Name=Audio To HDMI Stereo
Exec=/usr/bin/pactl set-card-profile 0 output:hdmi-stereo-extra1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment