From 0c1670068ce14057460cab2aa4a99b75de333821 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Tue, 21 Feb 2023 17:49:55 +0100 Subject: [PATCH] status bar icon resizing --- .local/bin/statusbar/sb-forecast | 2 +- .local/bin/statusbar/sb-nettraf | 6 +++++- .local/bin/statusbar/sb-packages | 4 ++-- .local/bin/statusbar/sb-playerctl | 9 +++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 55c7c093c..3fa62fd74 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -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 diff --git a/.local/bin/statusbar/sb-nettraf b/.local/bin/statusbar/sb-nettraf index 687c4ec2b..2aea2c3ec 100755 --- a/.local/bin/statusbar/sb-nettraf +++ b/.local/bin/statusbar/sb-nettraf @@ -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) diff --git a/.local/bin/statusbar/sb-packages b/.local/bin/statusbar/sb-packages index 31d8862ec..1369db6ef 100755 --- a/.local/bin/statusbar/sb-packages +++ b/.local/bin/statusbar/sb-packages @@ -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 diff --git a/.local/bin/statusbar/sb-playerctl b/.local/bin/statusbar/sb-playerctl index 4a76665f7..0e4d7c897 100755 --- a/.local/bin/statusbar/sb-playerctl +++ b/.local/bin/statusbar/sb-playerctl @@ -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"