pinwheel: Remove mullvad

This commit is contained in:
Alexander Heldt
2024-09-12 15:32:58 +02:00
parent e2d97c4f60
commit 2edf3980f0
4 changed files with 0 additions and 96 deletions

View File

@@ -84,52 +84,6 @@ let
esac
'';
mullvad = pkgs.writeShellScript "mullvad" ''
STATUS_DISCONNECTING="Disconnecting"
STATUS_DISCONNECTED="Disconnected"
STATUS_CONNECTING="Connecting"
STATUS_CONNECTED="Connected"
status() {
STATUS=$(${pkgs.mullvad}/bin/mullvad status | ${pkgs.gawk}/bin/awk 'NR==1{print $1}')
echo $STATUS
}
output() {
case $(status) in
$STATUS_DISCONNECTED)
echo '{ "text": "", "class": "disconnected" }' ;;
$STATUS_CONNECTING)
echo '{ "text": "", "tooltip": "Connecting", "class": "disconnected" }' ;;
$STATUS_CONNECTED)
TOOLTIP=$(${pkgs.mullvad}/bin/mullvad status | ${pkgs.gawk}/bin/awk 'NR==1')
echo "{ \"text\": \"\", \"tooltip\":\"$TOOLTIP\" }" ;;
$STATUS_DISCONNECTING)
echo '{ "text": "", "tooltip": "Disconnecting", "class": "disconnected" }' ;;
*)
echo '{ "text": "", "tooltip": "Status unknown", "class": "disconnected" }' ;;
esac
}
toggle() {
CURRENT_STATUS=$(status)
case "$CURRENT_STATUS" in
$STATUS_DISCONNECTED)
${pkgs.mullvad}/bin/mullvad connect --wait > /dev/null && ${pkgs.libnotify}/bin/notify-send "Connected to VPN";;
$STATUS_CONNECTED)
${pkgs.mullvad}/bin/mullvad disconnect --wait > /dev/null && ${pkgs.libnotify}/bin/notify-send "Disconnected from VPN";;
esac
}
case $1 in
--toggle)
toggle ;;
--output)
output ;;
esac
'';
work-vpn-status = pkgs.writeShellScript "work-vpn-status" ''
STAGING=$(systemctl is-active openvpn-work-staging.service)
[ "$STAGING" == "active" ] && echo "WORK-VPN STAGING ON" && exit 0
@@ -175,7 +129,6 @@ in
"custom/spotify"
"custom/container-status"
"custom/dunst"
"custom/mullvad"
"bluetooth"
"wireplumber"
"custom/tailscale"
@@ -216,13 +169,6 @@ in
interval = 2;
};
"custom/mullvad" = {
exec = "${mullvad} --output";
return-type = "json";
on-click-right = "${mullvad} --toggle";
interval = 2;
};
bluetooth = {
"format-off" = "󰂲";
"format-on" = "";
@@ -339,10 +285,6 @@ in
color: #${config.lib.colors.warning};
}
#custom-mullvad.disconnected {
color: #${config.lib.colors.warning};
}
#custom-work-vpn-status {
color: #${config.lib.colors.warning};
}