Finished script to set wireless nic

This commit is contained in:
Vlad Doster 2020-03-06 12:06:40 -05:00
parent ecc9365a1e
commit b7069be978
2 changed files with 6 additions and 2 deletions

View File

@ -200,7 +200,7 @@ bar-volume-empty-foreground = ${colors.gray}
[module/wifi]
type = internal/network
interface = wlo1
interface = wlp2s0
interval = 3.0
format-connected = <label-connected>

View File

@ -1,3 +1,7 @@
#!/bin/zsh
echo `lshw 2>/dev/null | grep -A 5 'description: Wireless interface' | tail -n 1 | awk '{print $3}'`
nic=`lshw 2>/dev/null | grep -A 5 'description: Wireless interface' | tail -n 1 | awk '{print $3}'`
sed -i "/wifi/{N;N;s/interface =.*/interface = $nic/;}" ~/.config/polybar/config
echo "Set wireless nic to $nic"