dotfiles

Luke's GNU/Linux dotfiles for i3, vim, ranger, bash, mpd, etc.
git clone git@git.lukesmith.xyz:dotfiles
Log | Files | Refs | README | LICENSE

commit cd667e6aa111c86b40b9e3104605953e9b341332
parent 9244feb6abb13377963fce969d35e1c75b7c7389
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sun,  4 Nov 2018 18:56:54 -0500

i3wifi primary

Diffstat:
M.config/i3blocks/config | 1-
M.scripts/i3wifi | 24++++--------------------
2 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/.config/i3blocks/config b/.config/i3blocks/config @@ -64,5 +64,4 @@ interval=30 [wifi] command=i3wifi -instance=wlp2s0 interval=10 diff --git a/.scripts/i3wifi b/.scripts/i3wifi @@ -1,25 +1,9 @@ -#!/bin/bash +#!/bin/sh case $BLOCK_BUTTON in - 1) $TERMINAL -e sudo -A wifi-menu ;; + 1) $TERMINAL -e nmtui ;; esac -INTERFACE="${BLOCK_INSTANCE:-wlan0}" +[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && echo 📡 && exit -[[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && echo 📡 && exit - -QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70 - 1) }') - -echo 📶 $QUALITY% -echo 📶 $QUALITY% - -# color -if [[ $QUALITY -ge 80 ]]; then - echo "#00FF00" -elif [[ $QUALITY -lt 40 ]]; then - echo "#FF0000" -elif [[ $QUALITY -lt 60 ]]; then - echo "#FF8000" -elif [[ $QUALITY -lt 80 ]]; then - echo "#FFF600" -fi +grep ^w /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }'