scripts/toggle_wifi.sh
2020-05-26 08:31:18 +02:00

12 lines
245 B
Bash
Executable File

#!/bin/bash
wifi_block=$(rfkill list wifi | grep Soft | awk '{print $3}')
if [ "$wifi_block" == "yes" ]
then
rfkill unblock wifi
notify-send "Wifi is now enabled"
else
rfkill block wifi
notify-send "Wifi is now disabled"
fi
sleep 0.2