1
0
Fork 0

don't resize sb icons

This commit is contained in:
Luca Bilke 2024-02-03 18:21:24 +01:00
parent 4d4d3e94f4
commit a87cfa097e
8 changed files with 10 additions and 16 deletions

View file

@ -3,8 +3,6 @@
fgalpha="FF"
bgalpha="CC"
export big="size=40"
export verybig="size=60"
export fgblack="foreground='#15161E$fgalpha'"
export fgred="foreground='#F7768E$fgalpha'"
export fggreen="foreground='#9ECE6A$fgalpha'"

View file

@ -7,7 +7,7 @@ temp=$(sensors | awk '/CPU/ {printf ("%.f°C", $2)}' | tr -d "+")
stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat 2>/dev/null)
[ ! -f $cache ] && echo "$stats" >"$cache"
old=$(cat "$cache")
printf "%b" "<span $big> </span>$temp"
printf "%b" "$temp"
echo "$stats" | while read -r row; do
id=${row%% *}
rest=${row#* }

View file

@ -25,12 +25,12 @@ readfile() {
}
output() {
readfile
printf "%b" "<span $verybig>$emoji</span> $precipitation <span $big $fgblue></span> $(echo "$highlow" | cut -d" " -f1)° <span $big $fgred></span> $(echo "$highlow" | cut -d" " -f2)°\n"
printf "%b" "$emoji $precipitation <span $fgblue></span> $(echo "$highlow" | cut -d" " -f1)° <span $fgred></span> $(echo "$highlow" | cut -d" " -f2)°\n"
}
if fresh; then
output
else
getforecast && pkill "-RTMIN+${1:-5}" dwmblocks &
printf "%b" "<span $big></span> Getting Weather\n"
printf "%b" " Getting Weather\n"
fi

View file

@ -1,5 +1,4 @@
#!/bin/sh
. "$HOME/.local/libexec/statusbar/colors"
shift=""
@ -7,7 +6,7 @@ if ls /sys/class/net/w*/operstate 1>/dev/null 2>&1; then
for w in /sys/class/net/w*/; do
percent="$(grep "$(basename "$(dirname "$w/operstate")")" /proc/net/wireless | tr -s ' ' | cut -d ' ' -f3 | tr -dc "[:digit:]")"
grep -vxq '0x1003' "$w/flags" && wifi_icon="" || wifi_icon="$(sed "s/up/󰖩/;s/down/󰖪/;s/dormant/󰤯/" "$w/operstate" | tr -d "[:space:]")"
printf "%b" "$shift<span $big>$wifi_icon</span> $percent"
printf "%b" "$shift$wifi_icon $percent"
shift=" "
done
fi
@ -21,7 +20,7 @@ fi
if ls /sys/class/net/tun*/operstate 1>/dev/null 2>&1; then
for _ in /sys/class/net/tun*/operstate; do
printf "%b" "$shift<span $big>󰖂</span>"
printf "%b" "$shift󰖂"
shift=" "
done
fi

View file

@ -1,3 +1,3 @@
#!/bin/sh
printf "%b" "\033[11m󰘚\033[10m "
printf "%b" "󰘚 "
free --mega | sed -n '2{p;q}' | awk '{printf ("%2.2fG/%2.2fG\n", ($3 / 1000), ($2 / 1000))}'

View file

@ -1,5 +1,4 @@
#!/bin/sh
. "$HOME/.local/libexec/statusbar/colors"
update() {
sum=0
@ -15,4 +14,4 @@ update() {
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
printf "%b%5sB %b%5sB%b" "<span$big></span>" "$(numfmt --to=iec "$rx")" "<span $big></span>" "$(numfmt --to=iec "$tx")" "\n"
printf "%b%5sB %b%5sB%b" "" "$(numfmt --to=iec "$rx")" "" "$(numfmt --to=iec "$tx")" "\n"

View file

@ -1,8 +1,7 @@
#!/bin/sh
. "$HOME/.local/libexec/statusbar/colors"
icon=""
num="$(\xbps-install -Sun | grep -c "update")"
[ "$num" -gt 0 ] && printf "%b" "<span $big>$icon</span> $num\n"
[ "$num" -gt 0 ] && printf "%b" "$icon $num\n"
exit 0

View file

@ -1,11 +1,10 @@
#!/bin/sh
. "$HOME/.local/libexec/statusbar/colors"
pidof -x sbd-playerctl >/dev/null 2>&1 || "$HOME/.local/libexec/daemons/sbd-playerctl" >/dev/null 2>&1 &
[ "$(playerctl status 2>&1)" = "No players found" ] && printf "%b" "<span $big></span>" && exit 1
[ "$(playerctl status 2>&1)" = "No players found" ] && printf "%b" "" && exit 1
# song="$(playerctl metadata xesam:artist) - $(playerctl metadata xesam:title)"
song="$(playerctl metadata xesam:title) - $(playerctl metadata xesam:artist)"
[ ${#song} -gt 35 ] && song="$(printf %.35s "$song")…"
icon="$(playerctl status | sed "s/Playing//;s/Paused//;s/Stopped/󰓛/;")"
printf "%b" "<span $big>$icon</span> $song"
printf "%b" "$icon $song"