Mute music player sound on browser audio.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This app only works for 🐧 using 🐍 2 or 3.


Nancho can be ran in the backgroud automatically as a service. However, as it needs access to the dbus operations on user-level, these need to be added to systemctl --user. The instructions below explain how to set this up.

Cloning the Repository

Clone the repository to somedir (where somedir is a directory name of your choosing).

cd /home/username/path/to/somedir
git clone

From now on, we'll refer to the path to the script as /home/user/path/to/somedir/nancho/ Please remember this somedir path, because you'll need it at more places in the set-up.

Adding the .service File

Now set up a systemd file like so:

sudo vi /etc/systemd/user/nancho.service

And add the following text:

Description=Automute Music on Browser Audio

ExecStart=/bin/sh /home/yourusername/path/to/somedir/nancho/


Note: change the /home/yourusername/path/to/somedir/ part to the correct one!

Configuring the .sh Script

Now configure (in /home/username/path/to/somedir/nancho/ to match your username and the somedir directory. Make sure that the directory is absolute!

vi /home/yourusername/path/to/somedir/nancho/

And change the directory in the first line:

/usr/bin/python3 /home/yourusername/path/to/somedir/nancho/ --browser=Firefox --music=Spotify --poll_time=2 --pause

If Python 2: change the python3 part in /usr/bin/python3 to either python2 or python.


Note that this uses default arguments for the code above (e.g. --browser=Firefox), for an overview and help see python -h. Moreoever, poll_time is set to 2 seconds - if you'd like more responsive pausing and trade-off some system load, decrease this number.

Running it as a Service

After you set this all up can run the service with:

systemctl --user start nancho

And check for any errors with:

systemctl --user status nancho

Note on Application Names (and New Firefox Versions Specifically)

Firefox has changed it's audio application name in newer Ubuntu / Firefox versions to AudioIPC Server. You can always refer to pacmd list-sink-inputs and check under for service identifiers to be put under the --browser and --music flags.