.files/.config/waybar/scripts/toggle_wifi

11 lines
193 B
Bash
Executable file

#!/usr/bin/env bash
# Check the current Wi-Fi state
state=$(nmcli radio wifi)
# Toggle Wi-Fi state
if [ "$state" == "enabled" ]; then
nmcli radio wifi off
else
nmcli radio wifi on
fi