Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -norc
- interface=wlan0
- link_quality=$(iwconfig $interface | awk '/Link Quality/{print $2}' | cut -f2 -d= | cut -f1 -d/)
- percentage=$(echo "scale=2;($link_quality/70)*100" | bc | rev | cut -f2 -d. | rev)
- volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | cut -f2 -d.)
- ssid=$(iwconfig $interface | awk '/ESSID/{print $4}' | cut -f2 -d'"' | cut -f1 -d/)
- bitrate=$(iwconfig wlan0 | awk '/Bit/{print $2}' | cut -f2 -d= | cut -f1 -d/)
- freq=$(iwconfig wlan0 | awk '/Frequency/{print $2}' | cut -f2 -d: | cut -f1 -d/)
- output=$(wpctl status | awk '/*/' | cut -f2 -d. | cut -f1 -d'[' | cut -c 2-99 | head -n 1)
- input=$(wpctl status | awk '/*/' | cut -f2 -d. | cut -f1 -d'[' | cut -c 2-99 | tail -1)
- echo -e "<txt>WFI: $percentage%\nSND: $volume%</txt>"
- echo -e "<tool><span font-family='terminus'>$interface</span>\n<span font-family='terminus'>SSID: $ssid</span>\n<span font-family='terminus'>Quality: $percentage%</span>\n<span font-family='terminus'>Bitrate: $bitrate</span><span font-family='terminus'>Mb/s</span>\n<span font-family='terminus'>Frequency: $freq</span><span font-family='terminus'>GHz</span>\n\n<span font-family='terminus'>Audio Output: $output</span>\n<span font-family='terminus'>Audio Input: $input</span></tool>"
Advertisement
Add Comment
Please, Sign In to add comment