mirror of
https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles.git
synced 2025-09-15 09:45:58 +03:00
switched from networkmanager
to iwd
This commit is contained in:
@@ -7,27 +7,27 @@ function airplane_mode_toggle
|
||||
set -l bluetooth_status (cat $backup_file | grep -o 'bluetooth:\(on\|off\)$' | cut -d':' -f2)
|
||||
|
||||
# Restore network states
|
||||
if test "$wifi_status" = "on"
|
||||
nmcli radio wifi on
|
||||
# else
|
||||
# nmcli radio wifi off
|
||||
if test "$wifi_status" = on
|
||||
rfkill unblock wifi
|
||||
# else
|
||||
# rfkill block wifi
|
||||
end
|
||||
|
||||
if test "$bluetooth_status" = "on"
|
||||
if test "$bluetooth_status" = on
|
||||
rfkill unblock bluetooth
|
||||
# else
|
||||
# rfkill block bluetooth
|
||||
# else
|
||||
# rfkill block bluetooth
|
||||
end
|
||||
|
||||
# Remove the backup file
|
||||
rm $backup_file
|
||||
else
|
||||
# Backup the current network states and turn off all networks
|
||||
echo "wifi:$(rfkill list wifi | grep -q "Soft blocked: no" && echo "on" || echo "off")" > $backup_file
|
||||
echo "bluetooth:$(rfkill list bluetooth | grep -qi "Soft blocked: no" && echo "on" || echo "off")" >> $backup_file
|
||||
echo "wifi:$(rfkill list wifi | grep -q "Soft blocked: no" && echo "on" || echo "off")" >$backup_file
|
||||
echo "bluetooth:$(rfkill list bluetooth | grep -qi "Soft blocked: no" && echo "on" || echo "off")" >>$backup_file
|
||||
# Add more lines to backup other network types if needed
|
||||
|
||||
nmcli radio wifi off
|
||||
rfkill block wifi
|
||||
rfkill block bluetooth
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -1,11 +1,11 @@
|
||||
function wifi_toggle
|
||||
set wifi_status (nmcli radio wifi)
|
||||
set wifi_status (rfkill list wifi | grep -i -o "Soft blocked: yes")
|
||||
set backup_file ~/.cache/airplane_backup
|
||||
|
||||
if [ "$wifi_status" = enabled ]
|
||||
nmcli radio wifi off
|
||||
if [ -z "$wifi_status" ]
|
||||
rfkill block wifi
|
||||
else
|
||||
nmcli radio wifi on
|
||||
rfkill unblock wifi
|
||||
if test -e $backup_file
|
||||
rm $backup_file
|
||||
end
|
||||
|
@@ -162,7 +162,7 @@
|
||||
// "tooltip-format-ethernet":"Interface: {ifname}\nIP: {ipaddr}\nGW: {gwaddr}\nNetmask: {netmask}\nCIDR: {cidr}\n\n<span color='#a6da95'>{bandwidthUpBits}</span>\t<span color='#ee99a0'>{bandwidthDownBits}</span>\t<span color='#c6a0f6'>{bandwidthTotalBits}</span>",
|
||||
"max-length": 35,
|
||||
"on-click": "fish -c wifi_toggle",
|
||||
"on-click-right": "wezterm start nmtui",
|
||||
"on-click-right": "iwgtk",
|
||||
},
|
||||
|
||||
"group/misc": {
|
||||
|
Reference in New Issue
Block a user