From 5d59b3927da16f589dfb961e54a86e6f14a480d6 Mon Sep 17 00:00:00 2001 From: mokulus <36231852+mokulus@users.noreply.github.com> Date: Fri, 24 Apr 2020 14:44:48 +0200 Subject: [PATCH] Fix minor statusbar issues (#597) * Fix: Remove trailing space from battery * Unify spacing in disk * Fix news Don't display news module when there are no news. * Use grep -F in pacpackages * Fix torrent Remove trailing whitespace *after* replacing newlines. * Quote sed command --- .local/bin/statusbar/battery | 2 +- .local/bin/statusbar/disk | 2 +- .local/bin/statusbar/news | 2 +- .local/bin/statusbar/pacpackages | 2 +- .local/bin/statusbar/torrent | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 981fc3a..5172e5a 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -24,4 +24,4 @@ do printf "%s%s%s%% " "$status" "$warn" "$capacity" unset warn -done | sed s/\ $/\\n/ +done | sed 's/* $//' diff --git a/.local/bin/statusbar/disk b/.local/bin/statusbar/disk index 269eba7..3e3f2e3 100755 --- a/.local/bin/statusbar/disk +++ b/.local/bin/statusbar/disk @@ -16,7 +16,7 @@ esac case "$location" in "/home"* ) icon="🏠" ;; "/mnt"* ) icon="💾" ;; - *) icon="🖥 ";; + *) icon="🖥";; esac printf "%s: %s\n" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')" diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index 455f64d..65ae7fd 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -13,4 +13,4 @@ case $BLOCK_BUTTON in Note: Only one instance of newsboat (including updates) may be running at a time." ;; esac - cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed s/^0$//g)$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)" + cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed 's/^📰 0$//g')$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)" diff --git a/.local/bin/statusbar/pacpackages b/.local/bin/statusbar/pacpackages index 49ba319..5a8d6f3 100755 --- a/.local/bin/statusbar/pacpackages +++ b/.local/bin/statusbar/pacpackages @@ -25,4 +25,4 @@ case $BLOCK_BUTTON in - Middle click to show upgradable packages" ;; esac -pacman -Qu | grep -cv "\[ignored\]" | sed "s/^/📦/;s/^📦0$//g" +pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g" diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent index 828ba44..5095cd6 100755 --- a/.local/bin/statusbar/torrent +++ b/.local/bin/statusbar/torrent @@ -14,7 +14,7 @@ transmission-remote -l | grep % | s/L/🔼/g; s/M/🔽/g; s/N/✅/g; - s/Z/🌱/g" | awk '{print $2, $1}' | sed -e "s/ $//g" | tr '\n' ' ' + s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed 's/ $//' case $BLOCK_BUTTON in 1) $TERMINAL -e tremc ;;