1
0
Fork 0

status bar icon resizing

This commit is contained in:
Luca Bilke 2023-02-21 17:49:55 +01:00
parent 1a46c273f2
commit 0c1670068c
4 changed files with 15 additions and 6 deletions

View File

@ -13,7 +13,7 @@ getforecast() {
showweather() {
emoji="$(printf "\033[12m%s\033[10m" $(cut -d ' ' -f 1 $emojifile))"
sed '16q;d' $weatherfile | grep -wo "[0-9]*%" | sort -rn | sed "s/^/$emoji /g;1q" | tr -d '\n'
sed '13q;d' $weatherfile | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " \033[34m\033[0m " $1 "°","\033[31m\033[0m " $2 "°"}'
sed '13q;d' $weatherfile | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " \033[34;11m\033[0m " $1 "°","\033[31;11m\033[0m " $2 "°"}'
}
getforecast
showweather

View File

@ -1,4 +1,8 @@
#!/bin/sh
big="\033[11m"
reset="\033[10m"
update() {
sum=0
for arg; do
@ -12,4 +16,4 @@ update() {
}
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
printf "%5sB %5sB\\n" $(numfmt --to=iec $rx $tx)
printf "$big$reset%5sB $big$reset%5sB\\n" $(numfmt --to=iec $rx $tx)

View File

@ -1,6 +1,6 @@
#!/bin/sh
if command -v pacman 1>/dev/null 2>&1; then
echo -n "$(pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/ /;s/^ 0$//g")"
echo -n "$(pacman -Qu | grep -Fcv "[ignored]" | sed "s/^//;s/^ 0$//g")"
fi
if command -v apt 1>/dev/null 2>&1; then
@ -11,5 +11,5 @@ if command -v apt 1>/dev/null 2>&1; then
print="$print$i/"
done
[ -n "$icon" ] && printf "$icon " && echo " $print" | sed 's/\/$//'
[ -n "$icon" ] && printf "$icon" && echo " $print" | sed 's/\/$//'
fi

View File

@ -1,8 +1,13 @@
#!/bin/sh
big="\033[11m"
reset="\033[10m"
pidof -x sbd-playerctl >/dev/null 2>&1 || sbd-playerctl >/dev/null 2>&1 &
[ "$(playerctl status 2>&1)" = "No players found" ] && echo ""ﱙ && exit 1
[ "$(playerctl status 2>&1)" = "No players found" ] && echo "$bigﱙ$reset" && 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//;")
icon="$big$(playerctl status | sed "s/Playing//;s/Paused//;")$reset"
echo "$icon $song"