feat: put spaces in statusbar modules

This commit is contained in:
David JULIEN 2021-02-16 20:53:50 +01:00
parent 82e236a2d9
commit 397f10b8d2
5 changed files with 11 additions and 9 deletions

View File

@ -27,7 +27,8 @@ do
status="$(cat "$bat/status")"
capacity="$(cat "$bat/capacity")"
if [ "$status" = "Full" ]; then
printf " FULL" && exit
status=" " && capacity="FULL"
printf " %s %s " "$status" "$capacity" && exit
elif [ "$status" = "Charging" ]; then
status=""
else
@ -39,5 +40,5 @@ do
*) status="" ; notify;;
esac
fi
printf "%s %3d%%\n" "$status" "$capacity";
printf " %s %3d%% " "$status" "$capacity";
done && return 0

View File

@ -12,9 +12,9 @@
# Wifi quality percentage and  icon if ethernet is connected.
wifi="$(grep "^\s*w" /proc/net/wireless | awk '{ printf int($3 * 100 / 70) }')"
[ $wifi -ne 0 ] && printf "直 %3d%%" $wifi || printf "睊 ---"
[ $wifi -ne 0 ] && printf " 直 %3d%% " $wifi || printf " 睊 --- "
eth="$(cat /sys/class/net/enp0s25/operstate)"
if [ "up" = "$eth" ]; then
printf " / "
printf " /  "
fi

View File

@ -22,4 +22,4 @@ do
done
[ -n "$unread" ] && unread="($(echo "$unread" | cut -c 2-))" || exit
printf " %s%s" "$unread" "$icon"
printf "  %s%s " "$unread" "$icon"

View File

@ -11,8 +11,9 @@
mpc="$(mpc --format "%albumartist% - %title%")"
format() { tac | sed "s/^volume: n\/a.*/ 🎵 ---/g;/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/ ⏸/g;s/\\[playing\\].*/ 🎵/g" | paste -sd ' ' -;}
format() { tac | sed "s/^volume:n\/a.*//g;/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;s/\\[playing\\].*/🎵/g" | paste -sd ' ' -;}
pgrep -f sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
echo "$mpc" | format
mpc=$(echo "$mpc" | format)
[ -n "$mpc" ] && printf " %s " "$mpc"

View File

@ -9,7 +9,7 @@
# @description : volume block for dwmblocks
######################################################################
[ "1" = $(pulsemixer --get-mute) ] && echo "婢 ---" && exit
[ "1" = $(pulsemixer --get-mute) ] && echo " 婢 --- " && exit
vol="$(pulsemixer --get-volume | awk -F " " '{ printf "%d", $1 }')"
@ -21,5 +21,5 @@ else
icon="奔"
fi
printf "%s %3d%%" $icon $vol
printf " %s %3d%% " $icon $vol