Add dotfiles
This commit is contained in:
parent
49bfe1a4d3
commit
b6e01a720b
52 changed files with 4701 additions and 0 deletions
24
dwmbar/modules/wifi
Executable file
24
dwmbar/modules/wifi
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Gets the wifi status
|
||||
|
||||
WIFI_FULL_ICON=''
|
||||
WIFI_MID_ICON=''
|
||||
WIFI_LOW_ICON=''
|
||||
NO_WIFI_ICON=''
|
||||
|
||||
get_wifi()
|
||||
{
|
||||
if grep -q wl* "/proc/net/wireless"; then
|
||||
# Wifi quality percentage
|
||||
percentage=$(grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70)}'| xargs)
|
||||
case $percentage in
|
||||
0) echo $NO_WIFI_ICON;;
|
||||
100|9[0-9]|8[0-9]|7[0-9]) echo "$WIFI_FULL_ICON" ;;
|
||||
6[0-9]|5[0-9]|4[0-9]|3[0-9]) echo "$WIFI_MID_ICON" ;;
|
||||
2[0-9]|1[0-9]|[0-9]) echo "$WIFI_LOW_ICON" ;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
get_wifi
|
Loading…
Add table
Add a link
Reference in a new issue