diff --git a/.config/scripts/wifi-bt.sh b/.config/scripts/wifi-bt.sh new file mode 100644 index 0000000..be3b698 --- /dev/null +++ b/.config/scripts/wifi-bt.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +case "$1" in + wifi) + WIFI_STATUS=$(nmcli radio wifi) + + if [ "$WIFI_STATUS" = "enabled" ]; then + # Wi-Fi KAPAT + nmcli radio wifi off + pkill nm-applet + else + # Wi-Fi AÇ + nmcli radio wifi on + sleep 0.3 + nm-applet & + fi + ;; + + bluetooth|bt) + BT_STATUS=$(bluetoothctl show | grep "Powered:" | awk '{pr> + + if [ "$BT_STATUS" = "yes" ]; then + # Bluetooth KAPAT + bluetoothctl power off + pkill blueman-applet + else + # Bluetooth AÇ + bluetoothctl power on + blueman-manager & + fi + ;; +esac diff --git a/.config/scripts/wifi.sh b/.config/scripts/wifi.sh deleted file mode 100644 index 09348d5..0000000 --- a/.config/scripts/wifi.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -STATUS=$(nmcli radio wifi) - -if [ "$STATUS" = "enabled" ]; then - # Wi-Fi KAPAT - nmcli radio wifi off - pkill nm-applet -else - # Wi-Fi AÇ - nmcli radio wifi on - nm-applet & -fi