diff --git a/.local/bin/tools/statusbar/cpu b/.local/bin/tools/statusbar/cpu index 8b028b4..8fef4e0 100755 --- a/.local/bin/tools/statusbar/cpu +++ b/.local/bin/tools/statusbar/cpu @@ -1,7 +1,12 @@ #!/bin/sh +icon="^b#282828^^c#dfdfdf^  ^d^ " + if [ "$1" = "amd" ]; then - sensors | awk '/Tctl/ {print "^b#282828^^c#dfdfdf^  ^d^ " $2}' + temp=$(sensors | awk '/Tctl/ {print $2}') elif [ "$1" = "intel" ]; then - sensors | awk '/Core 0/ {print "^b#282828^^c#dfdfdf^  ^d^ " $3}' + temp=$(sensors | awk '/Tctl/ {print $3}') fi + +temp=$(printf %3s $(echo ${temp##*+} | sed "s/\..*//") | tr ' ' ' ') +echo "$icon$temp°C" diff --git a/.local/bin/tools/statusbar/internet b/.local/bin/tools/statusbar/internet index fbe4c99..99fa2da 100755 --- a/.local/bin/tools/statusbar/internet +++ b/.local/bin/tools/statusbar/internet @@ -1,8 +1,10 @@ #!/usr/bin/env sh -# -[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^d^ -%" +wifipercent=" ___" -[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "^c#dfdfdf^ ^d^", int($3 * 100 / 70) "%" }') +[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^d^" -printf "%s %s\n" "$(cat /sys/class/net/e*/operstate | sed "s/down/^b#282828^^c#ff0000^  /;s/up/^b#282828^^c#dfdfdf^ 󰈀 /")" "$wifiicon" +[ ! -n "${wifiicon+var}" ] && wifiicon="^c#dfdfdf^ ^d^" && wifipercent=$(grep "^\s*w" /proc/net/wireless | awk '{ print int($3 * 100 / 70) }') + +wifipercent=$(printf %3s $wifipercent | tr ' ' ' ') +echo "$(cat /sys/class/net/e*/operstate | sed "s/down/^b#282828^^c#ff0000^  /;s/up/^b#282828^^c#dfdfdf^ 󰈀 /")" "$wifiicon" "$wifipercent%" diff --git a/.local/bin/tools/statusbar/memory b/.local/bin/tools/statusbar/memory index b88204d..6483487 100755 --- a/.local/bin/tools/statusbar/memory +++ b/.local/bin/tools/statusbar/memory @@ -1,3 +1,5 @@ #!/bin/sh -free -h | awk '/^Mem:/ {print "^b#282828^^c#dfdfdf^  ^d^ " $3 "/" $2}' +icon="^b#282828^^c#dfdfdf^  ^d^ " +total=$(free -h | awk '/^Mem:/ {print $3/$2}') +echo "$icon$(printf %3s $(echo ${total##*0.} | cut -c1-2) | tr ' ' ' ')%" diff --git a/.local/bin/tools/statusbar/volume b/.local/bin/tools/statusbar/volume index 2eea946..ab17ed6 100755 --- a/.local/bin/tools/statusbar/volume +++ b/.local/bin/tools/statusbar/volume @@ -3,14 +3,14 @@ vol="$(pulsemixer --get-volume | awk '{print $1}')" if [ "$vol" -eq "0" ]; then - vol_info="^c#ff0000^ ^d^ $vol%" + vol_info="^d^ " elif [ "$vol" -gt "70" ]; then - vol_info="^c#dfdfdf^ ^d^ $vol%" + vol_info="^c#dfdfdf^ ^d^" else - vol_info="^c#dfdfdf^ ^d^ $vol%" + vol_info="^c#dfdfdf^ ^d^" fi -[ "$(pulsemixer --get-mute)" = "1" ] && vol_info="^c#ff0000^ ^d^ -%" +[ "$(pulsemixer --get-mute)" = "1" ] && vol_info="^c#ff0000^ ^d^" if amixer get Capture | tail -2 | grep -q '\[on\]'; then mic="^b#282828^^c#dfdfdf^  " @@ -18,4 +18,5 @@ else mic="^b#282828^^c#ff0000^  " fi -printf "%s %s %s\\n" "$mic" "$vol_info" +vol=$(printf %3s $vol | tr ' ' ' ') +printf "%s %s %s %s\\n" "$mic" "$vol_info" "$vol%"