Just needed a simple way to see if I'm connected to Mullvad VPN and what server I'm using, so I made this simple custom waybar module.
- mullvad-vpn or mullvad-vpn-bin installed and setup on your system.
1. Clone the repo
git clone git@github.com:dottmp/mullvad-waybar-module.git2. If you haven't already installed mullvad-vpn, you can install it with yay:
# or mullvad-vpn if you prefer the non-bin version
yay -S mullvad-vpn-bin3. Copy the mullvad script
# ~/.config/waybar/scripts/mullvad.sh is just a suggestion, you can put it wherever you like
mkdir -p ~/.config/waybar/scripts && cp mullvad-waybar-module/mullvad.sh ~/.config/waybar/scripts/mullvad.sh4. Add the module to your waybar config
Paste the module into your ~/.config/waybar/config.jsonc
Note
Adjust the exec and on-click paths if you placed the script somewhere else.
Then add "custom/mullvad" to your modules-left, modules-center, or modules-right array to use it.
"modules-left": [],
"modules-center": [],
"modules-right": ["custom/mullvad"]5. Append the styles to your waybar style.css
# ~/.config/waybar/style.css is just a suggestion, you can put it wherever you like
cat mullvad-waybar-module/style.css >> ~/.config/waybar/style.css@define-color error #F96184;
@define-color foreground #D3D9FF;
@define-color success #01D38F;
#custom-mullvad {
min-width: 14px;
margin: 0 7.5px;
}
#custom-mullvad.connecting {
color: @foreground;
}
#custom-mullvad.connected {
color: @success;
}
#custom-mullvad.disconnected {
font-size: 16px;
margin: 0 7.5px 0 4.5px;
color: @error;
}6. Restart waybar
killall waybar && waybar &done!
Thanks to Mullvad for providing a great product!
and many appreciation to the waybar project as well ofc!
https://github.com/Alexays/Waybar
Contributions are welcome! Please submit pull requests or open issues for any suggestions, bug reports, or improvements.
