updating icons, status-net is borked for wifi :(
This commit is contained in:
parent
cd3b6a94e5
commit
5443ed150a
@ -13,7 +13,7 @@ numlockx
|
|||||||
|
|
||||||
nextcloud --background &
|
nextcloud --background &
|
||||||
|
|
||||||
nitrogen --restore
|
"$HOME/.fehbg"
|
||||||
|
|
||||||
# set default desktop window layout
|
# set default desktop window layout
|
||||||
"$HOME/.screenlayout/default.sh"
|
"$HOME/.screenlayout/default.sh"
|
||||||
|
|||||||
@ -9,5 +9,5 @@ case $BUTTON in
|
|||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
free --mebi | sed -n '2{p;q}' | awk '{printf (" %2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'
|
free --mebi | sed -n '2{p;q}' | awk '{printf (" %2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'
|
||||||
|
|
||||||
|
|||||||
@ -6,23 +6,30 @@
|
|||||||
|
|
||||||
case $BUTTON in
|
case $BUTTON in
|
||||||
1) "$TERMINAL" -e nmtui; pkill -RTMIN+15 dwmblocks ;;
|
1) "$TERMINAL" -e nmtui; pkill -RTMIN+15 dwmblocks ;;
|
||||||
3) notify-send "Internet module" "Shows network status
|
3) notify-send "Internet module" "- Click to connect
|
||||||
- Click to connect
|
: wifi disabled
|
||||||
❌: wifi disabled
|
|
||||||
: no wifi connection
|
: no wifi connection
|
||||||
: wifi connection with quality
|
: wifi connection with quality
|
||||||
❎: no ethernet
|
: no ethernet
|
||||||
: ethernet working
|
: ethernet working
|
||||||
🔒: vpn is active
|
: vpn is active
|
||||||
" ;;
|
" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
|
|
||||||
ssid="$(iw dev $(cat /proc/net/wireless | grep '^.*:' | sed 's/:.*//') link | grep -i SSID)"
|
# Wifi
|
||||||
wifiicon="$(awk '/^\s*w/ { print " ", int($3 * 100 / 70) "%" }' /proc/net/wireless) ${ssid##*SSID: } "
|
if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then
|
||||||
elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
|
wifiicon="$(awk '/^\s*w/ { print " ", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
|
||||||
grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon=" " || wifiicon="❌ "
|
elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
|
||||||
|
[ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon=" " || wifiicon=" "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)"
|
# Ethernet
|
||||||
|
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon=""
|
||||||
|
|
||||||
|
# TUN
|
||||||
|
[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" "
|
||||||
|
|
||||||
|
printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon"
|
||||||
|
|
||||||
|
|||||||
@ -9,4 +9,4 @@ case $BUTTON in
|
|||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/ /;s/^ 0$//g"
|
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/ /;s/^ 0$//g"
|
||||||
|
|||||||
@ -16,8 +16,8 @@ esac
|
|||||||
|
|
||||||
vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
||||||
|
|
||||||
# If muted, print 🔇 and exit.
|
# If muted, print and exit.
|
||||||
[ "$vol" != "${vol%\[MUTED\]}" ] && echo " " && exit
|
[ "$vol" != "${vol%\[MUTED\]}" ] && echo " " && exit
|
||||||
|
|
||||||
vol="${vol#Volume: }"
|
vol="${vol#Volume: }"
|
||||||
|
|
||||||
@ -32,10 +32,10 @@ vol="$(split "$vol" ".")"
|
|||||||
vol="${vol##0}"
|
vol="${vol##0}"
|
||||||
|
|
||||||
case 1 in
|
case 1 in
|
||||||
$((vol >= 70)) ) icon="" ;;
|
$((10#$vol >= 70)) ) icon=" " ;;
|
||||||
$((vol >= 30)) ) icon="" ;;
|
$((10#$vol >= 30)) ) icon=" " ;;
|
||||||
$((vol >= 1)) ) icon="" ;;
|
$((10#$vol >= 1)) ) icon=" " ;;
|
||||||
* ) echo " " && exit ;;
|
* ) echo " " && exit ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "$icon $vol%"
|
echo "$icon $vol%"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user