Skip to content

Commit 60eb118

Browse files
Merge pull request #314 from Theoreticallyhugo/fix/remove-playerctl-output-when-empty
check whether output is empty and exit before entering scrolling output
2 parents d7c7dc9 + 12f7247 commit 60eb118

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/playerctl.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ main() {
4141
start=0
4242
len=${#playerctl_playback}
4343

44+
# previously we have appended a space to playerctl_playback
45+
# if there is no player, len sees only one space
46+
# exit the script and output nothing if there is just that space
47+
if [[ $len == 1 ]]; then
48+
exit
49+
fi
50+
4451
scrolling_text=""
4552

4653
for ((start = 0; start <= len; start++)); do

0 commit comments

Comments
 (0)