1
0
Fork 0
dotfiles/.local/bin/rofi-vpn
Lucas Sta Maria 48cd765ce9
feat(rofi): add rofi config and scripts
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
2024-01-29 00:17:19 -05:00

24 lines
562 B
Bash
Executable file

#!/usr/bin/env bash
print_opts() {
printf "reconnect\nconnect\ndisconnect\n"
}
main() {
selected="$(print_opts 2>/dev/null \
| rofi -dmenu -p 'mullvad')"
case "$selected" in
"reconnect")
mullvad reconnect && sleep 1 && notify-send "Mullvad VPN" "$(mullvad status)"
;;
"connect")
mullvad connect && sleep 1 && notify-send "Mullvad VPN" "$(mullvad status)"
;;
"disconnect")
mullvad disconnect && sleep 1 && notify-send "Mullvad VPN" "$(mullvad status)"
;;
esac
}
main