From c075127aaee99d072fdb887c0986fd6dc5c8c533 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 25 May 2020 17:06:24 -0400 Subject: [PATCH] no spaces between icons and content --- .local/bin/statusbar/clock | 5 +---- .local/bin/statusbar/cpu | 2 +- .local/bin/statusbar/crypto | 4 ++-- .local/bin/statusbar/internet | 2 +- .local/bin/statusbar/mailbox | 2 +- .local/bin/statusbar/memory | 2 +- .local/bin/statusbar/news | 2 +- .local/bin/statusbar/torrent | 2 +- .local/bin/statusbar/volume | 2 +- .local/bin/statusbar/weather | 4 ++-- 10 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index 49cdc0b..431a7f0 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -26,7 +26,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -printf '%s %s%s\n' "$(date '+%Y %b %d (%a)')" "$icon" "$(date '+%I:%M%p')" - -#for europeans, use this -#printf '%s %s%s\n' "$(date '+%a %d/%m')" "$icon" "$(date '+%I:%M%p')" +date "+%Y %b %d (%a) $icon%I:%M%p" diff --git a/.local/bin/statusbar/cpu b/.local/bin/statusbar/cpu index b26f9d9..9225c1e 100755 --- a/.local/bin/statusbar/cpu +++ b/.local/bin/statusbar/cpu @@ -9,4 +9,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -sensors | awk '/Core 0/ {print "🌡", $3}' +sensors | awk '/Core 0/ {print "🌡" $3}' diff --git a/.local/bin/statusbar/crypto b/.local/bin/statusbar/crypto index 2e37f13..bb19fc9 100755 --- a/.local/bin/statusbar/crypto +++ b/.local/bin/statusbar/crypto @@ -28,8 +28,8 @@ printprices() { # Print/format all prices for x in "$dir"/*; do [ -f "$x" ] || break info="$(cut -d';' -f-2 --output-delimiter=' ' "$x")" - printf "%s $%0.2f " $info - done | sed "s/ $/\n/" + printf "%s$%0.2f " $info + done | sed 's/ $/\n/' } [ ! -d "$dir" ] && mkdir -p "$dir" && { getprices; exit ;} diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index 94eb47f..d8bd896 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -4,7 +4,7 @@ # Show 🌐 if connected to ethernet or ❎ if none. case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e nmtui & ;; + 1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;; 3) notify-send "🌐 Internet module" "\- Click to connect 📡: no wifi connection 📶: wifi connection with quality diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index 9560388..d04b971 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -17,4 +17,4 @@ unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx icon="$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)" -[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬 $unread$icon" +[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬$unread$icon" diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory index 0d64508..07a0f41 100755 --- a/.local/bin/statusbar/memory +++ b/.local/bin/statusbar/memory @@ -9,4 +9,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠 %2.2fGiB/%2.2fGiB", ( $3 / 1024), ($2 / 1024))}' +free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}' diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index ffaadfb..69d9bf3 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -14,4 +14,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; 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/torrent b/.local/bin/statusbar/torrent index a550c62..e9e7fce 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}' | paste -sd ' ' + s/Z/🌱/g" | awk '{print $2 $1}' | paste -sd ' ' case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e tremc & ;; diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index 8df98c8..b64744f 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -35,4 +35,4 @@ else icon="🔉" fi -printf "%s %s%%\\n" "$icon" "$vol" +printf "%s%s%%\\n" "$icon" "$vol" diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 76a84d9..2599e91 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -12,8 +12,8 @@ getforecast() { curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:-$HOME/.local/sh # precipication chance and the daily high and low from the downloaded file and # display them with coresponding emojis. showweather() { printf "%s" "$(sed '16q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | - grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" -sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶",$1 "°","🌞",$2 "°"}' ;} + grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔/g;1q" | tr -d '\n')" +sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;} case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;;