diff --git a/home/.config/fish/functions/bluetooth_toggle.fish b/home/.config/fish/functions/bluetooth_toggle.fish index f563f2c..4515efa 100644 --- a/home/.config/fish/functions/bluetooth_toggle.fish +++ b/home/.config/fish/functions/bluetooth_toggle.fish @@ -1,9 +1,13 @@ function bluetooth_toggle set bluetooth_status (rfkill list bluetooth | grep -i -o "Soft blocked: yes") + set backup_file ~/.cache/airplane_backup if [ -z "$bluetooth_status" ] rfkill block bluetooth else rfkill unblock bluetooth + if test -e $backup_file + rm $backup_file + end end -end \ No newline at end of file +end diff --git a/home/.config/fish/functions/wifi_toggle.fish b/home/.config/fish/functions/wifi_toggle.fish index 97f7e92..ee34fe2 100644 --- a/home/.config/fish/functions/wifi_toggle.fish +++ b/home/.config/fish/functions/wifi_toggle.fish @@ -1,9 +1,13 @@ function wifi_toggle set wifi_status (nmcli radio wifi) + set backup_file ~/.cache/airplane_backup - if [ "$wifi_status" = "enabled" ] + if [ "$wifi_status" = enabled ] nmcli radio wifi off else nmcli radio wifi on + if test -e $backup_file + rm $backup_file + end end -end \ No newline at end of file +end