diff options
author | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-06-13 11:45:42 +0200 |
---|---|---|
committer | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-06-13 11:45:42 +0200 |
commit | f8300930a8add8541f91ad08d07571c7394d3831 (patch) | |
tree | 73452d6ae57f352cdccafc38d5ae9ed79e3d3797 | |
parent | Updated status bar formatting (diff) | |
download | dwm-f8300930a8add8541f91ad08d07571c7394d3831.tar.gz dwm-f8300930a8add8541f91ad08d07571c7394d3831.tar.bz2 dwm-f8300930a8add8541f91ad08d07571c7394d3831.zip |
Added if statements in the status script
-rwxr-xr-x | scripts/dwm-status | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/scripts/dwm-status b/scripts/dwm-status index f400f34..0d64a95 100755 --- a/scripts/dwm-status +++ b/scripts/dwm-status @@ -42,6 +42,23 @@ tor() { fi } +wireless() { + +# Check internet connection + + + if grep -q wlan* "/proc/net/wireless"; then + # Wifi quality percentage + grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70) "%" }' + echo $delim + else + echo "" + fi + + + +} + # Here is the (big) function that outputs the appearance of the statusbar. It # can really be broken down into many submodules which I've commented and # explained. @@ -72,13 +89,12 @@ status() { \ echo "$delim" - # Wifi quality percentage - grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70) "%" }' + echo $(wireless) # Show unread mail command -v mw >/dev/null 2>&1 && echo "$delim" && - du -a ~/Mail/*/INBOX/new/* 2>/dev/null | wc -l | sed 's/^/:/' + du -a ~/Mail/*/INBOX/new/* 2>/dev/null | wc -l | sed 's/^/:/' && echo "$delim" CPU_T=$(< /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input) |