From 9a17694bc99adb4ba38ac54e116ce97644b77ebc Mon Sep 17 00:00:00 2001 From: Riyyi Date: Fri, 18 Mar 2022 13:13:31 +0100 Subject: [PATCH] Config: Prevent warning on the first exec of the btc polybar module --- .local/bin/panel/btc.sh | 10 +++++++--- .local/bin/volctl | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.local/bin/panel/btc.sh b/.local/bin/panel/btc.sh index 00cce86..44d25b6 100755 --- a/.local/bin/panel/btc.sh +++ b/.local/bin/panel/btc.sh @@ -30,9 +30,13 @@ output() { echo "%{F$color}$symbol $difference%%{F$COLOR15}" } -# Only pull if older than 10 seconds -lastModified=$(calc "$(date +%s) - $(date +%s -r $file) >= 10" | cut -c 1) -if [ "$lastModified" -eq 0 ]; then cat "$file"; exit; fi +if [ ! -f "$file" ]; then + touch "$file" +else + # Only pull if older than 10 seconds + lastModified=$(calc "$(date +%s) - $(date +%s -r $file) >= 10" | cut -c 1) + if [ "$lastModified" -eq 0 ]; then cat "$file"; exit; fi +fi # Get dates date_last_week_start="$(date --date 'last week' +%s000)" diff --git a/.local/bin/volctl b/.local/bin/volctl index e7ad968..ed9df4c 100755 --- a/.local/bin/volctl +++ b/.local/bin/volctl @@ -77,6 +77,7 @@ done pulseTcp() { if test "$2" = "off" || test "$2" = "0"; then + echo "Disabling PulseAudio TCP module" if pactl list modules short | grep -q module-simple-protocol-tcp; then pactl unload-module module-simple-protocol-tcp fi