This Python script monitors the connection status of Mullvad VPN and alerts you with a sound when it disconnects.
- Monitors Mullvad VPN connection status
- Plays a sound alert when the VPN disconnects
- Customizable alert sound
Before running the script, ensure that you have the following installed:
- Python 3.x (preferably Python 3.6 or later)
- pygame (for playing sound)
-
Install Python (if not already installed):
-
On Linux (Ubuntu/Debian-based):
sudo apt update sudo apt install python3 python3-pip
-
On macOS (if Python 3 isn't installed):
brew install python3
-
On Windows, you can download Python from here.
-
-
Install pygame: Pygame is used for playing sound alerts. Install it via pip:
pip3 install pygame
The script uses an MP3 file to play an alert when Mullvad VPN disconnects. By default, the script points to /home/samsep10l/loud.mp3 for the alert sound.
-
Prepare your MP3 file:
- Place your custom MP3 file somewhere accessible on your computer.
- For example, you can store it in your Music folder or any other directory.
-
Edit the script:
-
Open the
alert_mullvad.pyfile and update thealert_soundvariable with the path to your own MP3 file:alert_sound = "/path/to/your/alert-sound.mp3"
-
Make sure the file path points to your new MP3 file.
-
-
Open a terminal and navigate to the directory where the script is saved:
cd /path/to/your/scriptpython3 alert_mullvad.py
- The script will check if Mullvad VPN is connected every 5 seconds. If it disconnects, it will play the alert sound you configured.