From e73907048e683616f741d0f153b9098779733190 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 31 May 2021 23:32:13 +0100 Subject: [PATCH] Update statusbar --- .local/bin/newsup | 17 ----------------- .local/bin/statusbar/sb-forecast | 2 +- .local/bin/statusbar/sb-speedtest | 14 ++++++++++++++ .local/bin/statusbar/sb-volume | 2 +- 4 files changed, 16 insertions(+), 19 deletions(-) delete mode 100755 .local/bin/newsup create mode 100755 .local/bin/statusbar/sb-speedtest diff --git a/.local/bin/newsup b/.local/bin/newsup deleted file mode 100755 index 29f2b3c..0000000 --- a/.local/bin/newsup +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# Set as a cron job to check for new RSS entries for newsboat. -# If newsboat is open, sends it an "R" key to refresh. - -ping -q -c 1 example.org > /dev/null || exit - -/usr/bin/notify-send "📰 Updating RSS feeds..." - -pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit - -echo 🔃 > /tmp/newsupdate -pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}" -/usr/bin/newsboat -x reload -rm -f /tmp/newsupdate -pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}" -/usr/bin/notify-send "📰 RSS feed update complete." diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 5c95197..37c8f03 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -69,7 +69,7 @@ show_weather() { symbol="$([[ $temperature -lt 15 ]] && echo īĢ || echo īŠ)" - echo " $temperature$symbol" + echo " $temperature $symbol" } case $BLOCK_BUTTON in diff --git a/.local/bin/statusbar/sb-speedtest b/.local/bin/statusbar/sb-speedtest new file mode 100755 index 0000000..9215488 --- /dev/null +++ b/.local/bin/statusbar/sb-speedtest @@ -0,0 +1,14 @@ +#!/bin/sh + +case $BLOCK_BUTTON in + 1) "$TERMINAL" -e speedtest-cli --secure --timeout 1 --no-upload ;; + 3) notify-send "🌐 Speedtest module" "\- Click to run" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + +download_speed="$(speedtest-cli --secure --timeout 1 --no-upload --csv)" + +[[ -z $download_speed ]] && + echo "" || + echo "$(echo $download_speed | + awk -F, '{ printf("%dī‚Ģ",(($7 / 1000000) + 0.5)) }')" diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index a27ed9d..dcdab8a 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -25,4 +25,4 @@ else icon="īšŠ" fi -echo "$icon$vol%" +echo "$icon $vol%"