Fixing Unmute in the Qtile Volume Widget On Ubuntu

Reading Time: 2 minutes

Check out this simple fix for Unmuting the volume when using Qtile on Ubuntu.

I love Qtile. As with any software, I sometimes run into some peculiarities that that can be both frustrating and quite interesting. So far the issues haven’t even been the fault of Qtile, other than the fact that Qtile hasn’t built in protective code to hide the faults of other misbahaving software.

The Issue:

When you mute your volume in Qtile using the volume widget, it creates and issues the following command:

amixer -D default -q sset Master toggle
# Source:

Due to a bug in the communication between the amixer and pulseaudio softwares, this will successfully mute the appropriate channels in amixer and pulseaudio. Then when you go to unmute it, the Volume Widget will issue the same toggle command, and not all of the necessary channels will be turned back on.

The Fix:

There are multiple aproaches to implementing a workaround for the bug. The one I prefer is to override the mute_command in the volume widget to specifically communicate with the pulseaudio server directly by adding this to your qtile configuration:


Also if you have any other hotkeys bound that unmute your volume, you’ll want to update those in your config as well so that they target the “pulse” device instead of the “default” or other device. Example:

key= [
    # Change the volume if your keyboard has special volume keys.
        [], "XF86AudioRaiseVolume",
        lazy.spawn("amixer -c 0 -q set Master 2dB+")
        [], "XF86AudioLowerVolume",
        lazy.spawn("amixer -c 0 -q set Master 2dB-")
        [], "XF86AudioMute",
        lazy.spawn("amixer -c 0 -D pulse -q set Master toggle")

    # Also allow changing volume the old fashioned way.
    Key([mod], "equal", lazy.spawn("amixer -c 0 -q set Master 2dB+")),
    Key([mod], "minus", lazy.spawn("amixer -c 0 -q set Master 2dB-")),

Fixing The Root Cause

I love workarounds, they kill blockers and let you keep moving. At the same time, I hate them because they don’t actually fix the issue. I did some light research into the root cause of this issue. The issue is due to a breakdown in the communication of amixer and pulseaudio. We need someone who knows C to review the bug report, source of each software, and commit a patch. If that’s you you’re awesome. Here are some resources:
Alsa (Amixer is an Alsa Utility) Developer Zone
Pulseaudio Source Code
Bug report

Leave a Reply

Your email address will not be published. Required fields are marked *