Skip to content

Commit

Permalink
Merge pull request #314 from Theoreticallyhugo/fix/remove-playerctl-o…
Browse files Browse the repository at this point in the history
…utput-when-empty

check whether output is empty and exit before entering scrolling output
  • Loading branch information
ethancedwards8 authored Nov 21, 2024
2 parents d7c7dc9 + 12f7247 commit 60eb118
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/playerctl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ main() {
start=0
len=${#playerctl_playback}

# previously we have appended a space to playerctl_playback
# if there is no player, len sees only one space
# exit the script and output nothing if there is just that space
if [[ $len == 1 ]]; then
exit
fi

scrolling_text=""

for ((start = 0; start <= len; start++)); do
Expand Down

0 comments on commit 60eb118

Please sign in to comment.